问题
I want to develop an vu-meter and it reacts with sound, like a live-wallpaper Can anybody help me...
回答1:
Use MediaRecorder.getMaxAmplitude
This method returns the maximum absolute amplitude that was sampled since the last call to this method. Call this only after the setAudioSource().
http://developer.android.com/reference/android/media/MediaRecorder.html
回答2:
I've post an answer in this other post that should help you. It gives you the amplitude of the output mix, but can even be specified for a special MediaPlayer session id =)
来源:https://stackoverflow.com/questions/7452497/how-to-get-amplitude-of-media-player-in-android