im trying to find a simple way to record audio to analyse it for its amplitude (volume) - nothing else. MediaRecorder.getMaxAmplitude() always returns 0 on my smartphone (Android 2.3.6, Galaxy S1 Plus), which is the case for many ppl (found a lot of references on stackoverflow). Funny thing is, it records the audio properly into a file with my voice on it...doenst make sense. On another smartphone (Galaxy S3 mini) the same code is working so it cant be a programming error... I also tried the musicg library, but not even the whistle demo of that library is detecting anything... Next thing i've tried was recording with AudioRecord class. Well, i get a stream of data then, but i got no idea what to do with that numbers - i dont see a way to get the volume out of that... As already said, i only need the volume of the sounds in my surroundings. Thanks in advance for your suggestions.
Asked
Active
Viewed 991 times
0
-
Possible duplicate of http://stackoverflow.com/questions/12018794/record-sound-in-android-and-read-amplitude – Kristy Welsh Sep 24 '14 at 18:12
-
You can also try this: http://www.doepiccoding.com/blog/?p=195 – Kristy Welsh Sep 24 '14 at 18:19
-
I just found that source, too. It seems to work. The author just gets the buffer contents of AudioRecord (method "read") and calculates the average...since its working, it means the values present the amplitude of the signal. Didnt know that. Its solved with that solution. Thank you. – V1nc3nt Sep 24 '14 at 19:02