daanzu / kaldi-active-grammar

Python Kaldi speech recognition with grammars that can be set active/inactive dynamically at decode-time
GNU Affero General Public License v3.0
332 stars 49 forks source link

Bluetooth Headset: No good block received #40

Open patricktouchette opened 3 years ago

patricktouchette commented 3 years ago

I have the following issue with my bluetooth headset. I am on Windows 10 running caster with kaldi. If I use separate sources for input (bluetooth microphone from headset) and output (Speakers hooked up to my screen), i get the following error.

...
INFO:engine:streaming audio from 'Headset (VXi B350-XT v3.33 Hand' using MME: 16000 sample_rate, 10 block_duration_ms, 30 latency_ms
...

*- Starting Caster v 1.6.16 -*
INFO:engine:Listening...
WARNING:engine:<dragonfly.engines.backend_kaldi.audio.VADAudio object at 0x000000000ED90E88>: no good block received recently, so reconnecting audio
Press any key to continue . . .

The mic works in audacity or for skype. Caster seems to recognize it, but then it crashes once the caster/kaldi engine is listening.

daanzu commented 3 years ago

Hmm, strange. Not sure why that would happen, but there is an easy way to disable at least the reconnection feature: set the engine parameter audio_auto_reconnect=False. You can do this on the dragonfly or caster command line, although I forget how exactly at the moment. Hopefully that gets it working. There is also an easy way to enable debug logging, which should hopefully display some useful messages to identify where and why it is exiting abruptly entirely.

LexiconCode commented 3 years ago

Just modify the bat file for now python -m dragonfly load-directory . --engine kaldi --engine-options "model_dir=kaldi_model, vad_padding_end_ms=300, audio_auto_reconnect=False"

List of kaldi engine parameters for configuration.