VU (Audio) when recording audio in Android

I am new to Android development, and for my first application, I created an application that allows you to record audio. Sound recording works the same as audio playback. One thing that is missing from the application is user feedback during recording as a vu counter. On the iOS platform, I believe that there is a built-in VU meter that can be used for applications. I could not find the equivalent on the Android platform.

I go through various forums on Android development and google search, but I have not found anything useful.

Does anyone know any coding examples of a digital VU meter for sound recording?

Does anyone know of any coding examples to show writeback feedback?

+4
source share
2 answers

You will need to write your own VU counter, but it is not so difficult.

First get the maximum maximum amplitude of the last set of sound samples. Flip the buffer that you fill with AudioRecord and pay attention to the highest value. This is pretty much what MediaPlayer.getAmplitude does internally.

Now that you have the amplitude, you just draw a thread or rectangle with a constant dimension (where height = MAX_RECT_HEIGHT * curAmplitude / CONST_MAXIMUM_AMPLITUDE) or something else in the draw () method of the user view. You will need to study peaks and decays, etc., but all you need.

You can view the source of the VU built-in live vests here: VU counter .

+2
source

Have you looked at the answers to this question: Access to the Android media stream for audio visualization ?

0
source

All Articles