Reputation: 589
I am developing an android application. I want to access the microphone in Background means when the screen is off. I don't want to record the sounds. What I need is to make an event to trigger if the amplitude exceeds some value. How can I achieve this ?
Thank you.
Upvotes: 1
Views: 1412
Reputation: 5286
You would need to start an Activity with a Service.
In the service, create a MediaRecorder object.
This class has a few methods for amplitude (one of them being getMaxAmplitude()
). You can use that along with a little bit of math to achieve what you want.
Upvotes: 1