Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to detect when a user stops talking into the microphone

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

How do I detect that the user has stopped talking and use that to trigger the recorder to stop?

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

As a side note I would also love to show some type of visual indicating that the microphone is receiving sound. Something to show the sound level coming in.

Any help appreciated.

like image 737
Doug Avatar asked Mar 09 '11 15:03

Doug


1 Answers

An approach is to use threads on recording and the speech power analyzing process on the recorded bytes, there's a sample code for your reference: http://musicg.googlecode.com/files/musicg_android_demo.zip

like image 91
dennisy Avatar answered Sep 28 '22 12:09

dennisy