alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.57k stars 1.06k forks source link

Speeding up speech recognition #1312

Closed nurgul-ths closed 1 year ago

nurgul-ths commented 1 year ago

Hello!

Could you please tell how the streaming part of vosk works? I am currently working on a project with DE1-SoC, which is running in C, and I have speech recognition working on it, however it takes about 30 seconds from the time I say something into the mic (then I create a wav file), and then get words. I am also using the lightest model (vosk-model-small-en-us-0.15) to speed up the process. I was thinking, if it is possible to stream the data to vosk rather than creating files, it might be better, but I need some help understanding how streaming part of vosk works.

Thank you!

nshmyrev commented 1 year ago

It is possible to stream, you can just check demo code:

https://github.com/alphacep/vosk-api/blob/master/c/test_vosk.c

If you need more detailed help you need to provide more information like code samples you wrote and so on.

nurgul-ths commented 1 year ago

Thanks for your reply. I am calling this file https://github.com/alphacep/vosk-api/blob/master/c/test_vosk.c once my wav file is generated. But then I have to wait about 30 seconds for the text to get printed out. @nshmyrev