-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Android BIP sound on start and stop recognizing #48
Comments
Any news on that @MacKentoch ? I would also like to remove that sound. |
This would be a nice option. |
@ghsdh3409 Ping. Time to sync with upstream? |
have u been able to do that? |
I (big) while ago, I made a plugin for Cordova, and came up with a dirty hack to turn the volume off while recognizing and turn it back on when done. It's not the best solution but it works fine for now. I don't know exactly how to implement it now because it's been ages since I work with android, but just for the heck of it, here's the code of that class: https://github.com/dalvallana/ContinuousSpeechRecognizer/blob/master/src/android/ContinuousSpeechRecognizer.java. Look for the |
any update? |
I also need such a function |
any update? |
Any update on this?? |
any Updateee? |
Any update? |
+1 |
any update |
@MacKentoch Did you solved your problem? |
Hello Guyz |
@lfoliveir4 no but try @vaibhgupta09 hack. This is by design in Android: recording audio triggers a BIP sound -system does it - (should be related to legal reasons I guess). So hacking is the only way to bypass as far as I know |
I'm not sure it's good idea to avoid that sound. This makes user to know about listening and as far as this library can start listen without user action it's better to keep BIP sound turned on. |
But it would be good if I could change that sound. I've seen solution for Android API. Maybe I will try it later |
bump |
wait this option |
any update? |
Any updates? |
Down vote |
Navigate to this file in: And there you can use the The patch encompasses the implementation of an Android-based speech recognition feature in a React Native application. It allows the application to mute background sound or music while the Speech Recognizer is capturing user speech. This has been achieved by employing the AudioManager, a core Android service that handles audio management, including volume and mode. At the start of the VoiceModule class, a private field for AudioManager and an integer field for StreamVolume is declared. The AudioManager is later used to manage audio properties when the microphone is active.
The application stores the current music stream volume in the mStreamVolume variable when the VoiceModule object is created. This original volume level is maintained for restoration once the speech recognition operation is completed.
When speech recognition begins, the application mutes the music stream volume. This ensures that the recognition process is not affected by any background music that might be playing.
After the startListening() function is called, the muteStreamVolume() function mutes the audio stream only if the original volume wasn't 0.
As soon as the recognition process is completed, the audio stream volume is restored to its original value. This is done in the onResults() method which is called when speech recognition results are ready.
The setStreamVolumeBack() function restores the original audio stream volume when called.
In conclusion, this patch significantly improves the user experience by ensuring that a user's voice command is not drowned out by background music during a voice-activated operation. This subtle yet essential modification enables users to interact more seamlessly with voice-activated applications and commands. IMPORTANT After you edit the library you need to patch the use this tool: |
In Android SpeechRecognizer emits (horrible) BIP sound when starting and ending recognition.
This by design but it would be awesome to be able to remove / mute these bips.
The text was updated successfully, but these errors were encountered: