user3218743
user3218743

Reputation: 589

Background accessing microphone in android

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

Answers (1)

MJ93
MJ93

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

Related Questions