How to record sound only if it is above a certain sound level?

I tried to make a voice capture application that is captured only when there is noise. Therefore, I used the getMaxAmplitude () method from the Media Recorder class. And here is my idea and work: I started the service that used the MediaRecorder object to record sound from the emulator’s microphone, then I have a stream that checks the getMaxAmplitude () value of this object, if it goes beyond a certain level, I start another recording using a new object from MediaRecorder for a certain period of time, and then save it. If after starting the service of my application there is, for example, “3 noises”, it should save 4 audio files, including the main one, which is used to control the amplitude level.

BUT I noticed a problem, that is, the android microphone allows only one media recorder at a time. So is there any other way to do this?

+4
source share
1 answer

You can mark the time stamps for the beginning and end of the noise, and then output the desired sections from the audio file later.

Of course, this may not correspond exactly to what you are trying to do ... it's hard to say at the moment.

0
source

All Articles