Closed The-Mr-L closed 2 years ago
Hi! This library links to the coqui-stt C library, which you can get here https://gh.weeb.love/coqui-ai/STT/releases/tag/v1.2.0. The process should be the same as on Linux and Mac, just make sure the libstt and libkenlm libraries are discoverable.
On Tue, Feb 22, 2022 at 9:31 AM LambdaMan2K @.***> wrote:
Hi, so I get this link error LINK : fatal error LNK1181: cannot open input file 'stt.lib' so I guess I need to download this lib right and point to it somehow maybe ? yes I am new to this speech tech :) and then i should have a pretrained model right? can you please give me a step by step for speech to text using this thank you
— Reply to this email directly, view it on GitHub https://github.com/tazz4843/coqui-stt/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQPUP7VQMIBTZ56FYOCWHB3U4O25BANCNFSM5PB4S3FQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
okay so I download the native client and extracted it to a folder called stt and added this to the path env bu ti keep getting fatal error LNK1181: cannot open input file 'stt.lib' in the native client for windows i I have coqui-stt.h generate_scorer_package KenLM_License_Info.txt libkenlm.so libkenlm.so.if.lib libstt.so libstt.so.if.lib LICENSE native_client.tflite.Windows.tar native_client.tflite.Windows.tar.xz stt.exe
but if you are not on windows I can understand it is hard for you to help
Sorry, I can't help myself as I'm on Linux with no access to any Windows system.
Okay no problem. can you maybe then tell me where in the code you get the path to the lib since I am pretty sure it just cant find it because it looks for Linux files? thank you
I got it working now, how would you go about streaming audio from mic, well my mic is 2 channels so this will not work or what? thank you
It'd be great if you could tell us how you got it working that way we can document it for others.
As for streaming audio from your mic, you can certainly do that, you just need to find a lib to process the audio to mono, or do it yourself with some code. Depending on your mic, you also probably need to resample it to the model's input sample rate (usually 16KHz). For resampling it, you can check out the examples directory, but for processing the audio to mono you'd probably need to figure that out yourself. I have done it by hand myself, which you can see here.
thanks for your response. I will dig more into it :), and yes ofc I will share what I did :) well I started with replacing the bindings.rs in sys crate with the one I crreated using bindgen on the header file in native_client but I am pretty sure that is not necessary. but what is necessary was creating a build.rs with the following
#[cfg(target_os = "windows")]
fn main() {
// necessary libraries: libstt.so, libkenlm.so, libstt.so.if.lib and libkenlm.so.if.lib.
println!(r"cargo:rustc-link-search=C:\stt");
println!("cargo:rustc-link-lib=dylib=libstt.so.if");
println!("cargo:rustc-link-lib=dylib=libkenlm.so.if");
}
Awesome, thanks for letting us know how :)
I doubt that replacing the sys bindings was required, since those are the same across all platforms.
I'll add it to the README.md/build.rs files at some point soon, or if you'd like to make a PR yourself, feel free to do so. Thanks!
No problem :) and one more little thing can you please, remove the mut keyword here
pub fn speech_to_text(&mut self, buffer: &[i16]) -> crate::Result<String> {
to
pub fn speech_to_text(&self, buffer: &[i16]) -> crate::Result<String> {
it should d not require mut right? I just removed it myself.. but it is just nice to have the change made here as well :)
I'm not sure either, but just to be safe I kept it there, as it was there in the original DeepSpeech bindings.
okay, but I am pretty sure it doss not mutate anything and it gives the same result without it being mutable. anyway thanks again for the repo.. you can just close this if you wish ;)
Whoops I wrote up a response a couple days ago to this but I since lost it, so I'll just close this now. Thanks anyways!
Published to crates.io. If it doesn't work, let me know and I can try messing around with it. Thanks again!
btw this ofc requires that you have the native client extracted to C:\stt.. this is just how I have it setup atm.
Hello! I followed the steps in the solution (putting the native client in C:\stt
) and I still get the same error.
Looking back at the original DeepSpeech project, I noticed one final change between this and the original bindings. I pushed it in 6367dbbaefa1fef0e9f1b72b7ffe0fcf6d6b9d5d, so you could try using this project from Git instead of crates.io and seeing if that helps.
coqui-stt = { git = "https://github.com/tazz4843/coqui-stt" }
With that version I get
error: could not open 'deepspeech.lib': no such file or directory
error: could not open 'stt.lib': no such file or directory
Whoops I just noticed a typo in it. Fixed the typo in 2bddc19cf71d1c7f8630c0a24633075f14f2c208. cargo update
to fix.
As for your issue, perhaps try having the library files in the same directory as your project, under those names in the error message. I'm really not sure what to try, so this is a shot in the dark.
Same error I'm afraid (just the stt.lib
one). I have a question though, how can cargo find a file that doesn't exist in the native client folder? (stt.lib).
I'm not even sure where it gets stt.lib, and I really don't have any more ideas. Sorry :(
I may have an idea, I'll make a fork and test it. Hopefully we can get this somewhere :D
Hi, so I get this link error LINK : fatal error LNK1181: cannot open input file 'stt.lib' so I guess I need to download this lib right and point to it somehow maybe ? yes I am new to this speech tech :) and then i should have a pretrained model right? can you please give me a step by step for speech to text using this thank you