Android: how to determine when a user stops talking with a microphone

I have an Android application that starts recording from a microphone when the application starts. In my current version, the user must press the STOP button to stop recording.

How do I know if a user has stopped talking and use this to stop the recorder?

Similar to what is implemented in the speech recognition functionality in Android. The user stops talking, and then speech is translated. I have seen other apps that do this, like Talking Tom apps.

As a side note, I would also like to show some kind of visual signal indicating that the microphone is receiving sound. Something to show the sound level.

Any help was appreciated.

+5
source share
2 answers

The approach is to use streams when recording and analyzing speech power in recorded bytes, there is an example code for your reference: http://musicg.googlecode.com/files/musicg_android_demo.zip

+5
source

What do you use to record sound? This may give some clues:

android.media.MediaRecorder:

  • the constant MEDIA_RECORDER_INFO_MAX_DURATION_REACHED can be used with onInfoListener.

android.speech.SpeechRecognizer:

  • attach RecognitionListener and call EndofSpeech ().
0
source

All Articles