tazz4843 / coqui-stt

Safe wrapper around the Coqui STT C library
108 stars 9 forks source link

Requesting More Examples #9

Closed jackpeters667 closed 2 years ago

jackpeters667 commented 2 years ago

Hey, thanks for this. May we have more examples? Particularly, streaming audio.

I can't find the threadsafe-streams feature in the crate and I want to use intermediate decode. Basically, I want to do multiple things with my audio stream. With coqui, I want to spawn a thread to do STT.

        stream.play().unwrap(); //from cpal
        streaming.feed_audio(&audio_buf_stream);
        println!("feeding audio");
        while let Ok(o) = streaming.intermediate_decode() {
            println!("{o}");
        }

I'm just getting eeeee as continuous output. Which also makes me wonder if I can transfer deepspeech models to here? Or would I have to retrain for coqui specifically since i'm getting garbage output? It's a tflite model.

I'm all over the place, but I'm just asking for an example to do speech to text in a new thread. And how would I enable threadsafe-streams feature, I can't find it

jackpeters667 commented 2 years ago

Turns out I had to tinker with the sample rate a little. I'm sorted, but may we please update the docs and examples. The docs still mention the features that (I think) have been removed

tazz4843 commented 2 years ago

Whoops, sorry for not seeing this for so long. Yes, those features were removed. I completely forgot to update the docs for those, I'll do that right now. As for examples, I'll try to add one for STT in another thread.

tazz4843 commented 2 years ago

Commit fc5f7f00f2d74df449ae1e896ff1f84a8bd6fcce adds a new thread example for future users. I couldn't find any references to those features in the docs though, so I'm not sure where you found them.