ndarilek / tts-rs

115 stars 25 forks source link

Can't compile on Ubuntu #47

Closed subalterngames closed 1 year ago

subalterngames commented 1 year ago

Crate version: 0.25.1 Ubuntu 20 CPU: x64

I have installed: clang, libclang1, libspeechd-dev

When I cargo run, I get:

   Compiling speech-dispatcher v0.16.0
error[E0425]: cannot find value `SPD_PUNCT_MOST` in module `SPDPunctuation`
    --> /home/esther/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speech-dispatcher-0.16.0/src/lib.rs:103:28
     |
103  |     Most = SPDPunctuation::SPD_PUNCT_MOST,
     |                            ^^^^^^^^^^^^^^ help: a constant with a similar name exists: `SPD_PUNCT_NONE`
     |
    ::: /home/esther/cacophony/target/debug/build/speech-dispatcher-sys-8b03c54eadb0c1c7/out/speech_dispatcher_sys.rs:1710:5
     |
1710 |     pub const SPD_PUNCT_NONE: Type = 1;
     |     ------------------------------ similarly named constant `SPD_PUNCT_NONE` defined here

error[E0081]: discriminant value `1` assigned more than once
   --> /home/esther/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speech-dispatcher-0.16.0/src/lib.rs:100:1
    |
100 | pub enum Punctuation {
    | ^^^^^^^^^^^^^^^^^^^^
...
103 |     Most = SPDPunctuation::SPD_PUNCT_MOST,
    |            ------------------------------ `1` assigned here
104 |     Some = SPDPunctuation::SPD_PUNCT_SOME,
105 |     None = SPDPunctuation::SPD_PUNCT_NONE,
    |            ------------------------------ `1` assigned here

error[E0308]: mismatched types
    --> /home/esther/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speech-dispatcher-0.16.0/src/lib.rs:420:54
     |
420  | ...unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
     |             ------------------          ^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
     |             |
     |             arguments to this function are incorrect
     |
note: function defined here
    --> /home/esther/cacophony/target/debug/build/speech-dispatcher-sys-8b03c54eadb0c1c7/out/speech_dispatcher_sys.rs:1960:12
     |
1960 |     pub fn spd_set_voice_type(
     |            ^^^^^^^^^^^^^^^^^^
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
     |
420  |         let v = unsafe { spd_set_voice_type(*self.0, (voice_type as i32).try_into().unwrap()) };
     |                                                      +                 +++++++++++++++++++++

error[E0308]: mismatched types
    --> /home/esther/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speech-dispatcher-0.16.0/src/lib.rs:428:58
     |
428  | ...safe { spd_set_voice_type_all(*self.0, voice_type as i32) };
     |           ----------------------          ^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
     |           |
     |           arguments to this function are incorrect
     |
note: function defined here
    --> /home/esther/cacophony/target/debug/build/speech-dispatcher-sys-8b03c54eadb0c1c7/out/speech_dispatcher_sys.rs:1966:12
     |
1966 |     pub fn spd_set_voice_type_all(
     |            ^^^^^^^^^^^^^^^^^^^^^^
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
     |
428  |         let v = unsafe { spd_set_voice_type_all(*self.0, (voice_type as i32).try_into().unwrap()) };
     |                                                          +                 +++++++++++++++++++++

error[E0308]: mismatched types
    --> /home/esther/.cargo/registry/src/index.crates.io-6f17d22bba15001f/speech-dispatcher-0.16.0/src/lib.rs:436:58
     |
436  | ...safe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_ui...
     |           ----------------------          ^^^^^^^^^^^^^^^^^ expected `u32`, found `i32`
     |           |
     |           arguments to this function are incorrect
     |
note: function defined here
    --> /home/esther/cacophony/target/debug/build/speech-dispatcher-sys-8b03c54eadb0c1c7/out/speech_dispatcher_sys.rs:1972:12
     |
1972 |     pub fn spd_set_voice_type_uid(
     |            ^^^^^^^^^^^^^^^^^^^^^^
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
     |
436  |         let v = unsafe { spd_set_voice_type_uid(*self.0, (voice_type as i32).try_into().unwrap(), target_uid) };
     |                                                          +                 +++++++++++++++++++++

Some errors have detailed explanations: E0081, E0308, E0425.
For more information about an error, try `rustc --explain E0081`.
error: could not compile `speech-dispatcher` (lib) due to 5 previous errors
warning: build failed, waiting for other jobs to finish...
ndarilek commented 1 year ago

Sounds like you're not using the right speechdispatcher* feature--in this case likely speech_dispatcher_0_9. Give that a shot and re-open if it doesn't work.