Closed EdwinVanRooij closed 4 years ago
Of course yes, the library is based solely on stock Android APIs, so if you found a way go ahead and send a PR 😎
I implemented functionality to mute the entire phone's audio output starting right before receiving speech input, until right receiving the results. This only happens when the user executes the next line:
Speech.getInstance().setMuteSpeechRecognizerSounds(true);
It's not precisely how I wanted to implement it. The ending 'beep' is still there. This still plays because the ending 'beep' is played after we receive the results. Google only provides onEndOfSpeech()
and onResults(...)
, not a desired afterBeepsoundPlayed()
or something.
Source: https://developer.android.com/reference/android/speech/RecognitionListener
Ps: The way I'm going to implement this in my app, is by muting the phone's audio before starting to listen for speech input, and unmuting it ~200ms after receiving my results. I did not want to include that solution into this codebase, because the 200ms is a guessed number as to when the sound would have been played, this may vary by device based on phone specs.
Ps2: Any ideas as to how to detect the end of the 'beep' sound played by the RecognitionListener would be appreciated, then it'd be possible to fully integrate this functionality into the library.
Closing this because it's not a sustainable feature to have
Would it be possible to mute the sounds which the underlying API makes? E.g. when we start listening for voice input, this would be the flow that the API goes through"
I do not like the 1 and 5 sounds, I've searched a bit and found this https://stackoverflow.com/a/37882934/5273299 and this https://android.stackexchange.com/a/129713 link. Would it be possible to integrate some solution into this library, and then setting the sound on/off based on a boolean?
Great library, thanks!