[Feature Request] Ability to mute / unmute the audio input stream
Is your feature request related to a problem? Please describe.
For my use case, I need to be able to programmatically mute / unmute the microphone (or input stream). My application alternates between TTS and user voice input, and the TTS gets picked up by the Vosk recognizer which then incorrectly gets processed as user input.
Describe the solution you'd like
I would like some methods to be exposed for muting / unmuting the input stream without needing to teardown and reinit the model every time.
Describe alternatives you've considered
- I have tried using .stop() and .start() to handle this, but tearing down and reinitializing the model every time is too slow, expensive, and unreliable for my application. The app alternates between TTS and user voice input every couple of seconds, and the user needs to be able to respond to the TTS prompt as quickly as 1000ms. This response time is measured and tracked, so I really need the Vosk stuff to add as little overhead as possible after it's initialized for the first time.
- I have tried setting a flag to simply ignore results coming through the mic while the TTS is active, but this results in a bunch of race condition edge-cases because the onResult resolution isn't predictable.
Additional context
This is sort of related to #133, but I imagine exposing mute / unmute on the input stream would be quite a bit easier than supporting full blown echo cancellation. That being said, I'm still getting up to speed on native APIs so I could definitely be wrong about that. Let me know what you think about this.
Thanks!
Sounds good, I may work on that later, I don't have enough time for now. If you have any chance to work on it, feel free to create a PR
I've used many libraries, and this one solved my real-time speech-to-text problem in Chinese. Now I want to add punctuation marks to the returned content based on semantic judgment. Are there any good methods for this?