Skip to content

[Feature Request] Ability to mute / unmute the audio input stream #138

@chxffre

Description

@chxffre

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

  1. 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.
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions