How to get amplitude of media player in Android ?

…衆ロ難τιáo~ 提交于 2021-02-11 18:18:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!