I am playing a mp3 file in my Android app using MediaPlayer
for Android 2.1. Now I want to display a equalizer(like below) during this music play.
Ca开发者_StackOverflown anyone give me any idea how to implement it or any code for that?
Android 2.3 and above contains support for applying effects to audio, one of which is a multi-band equalizer (on all of the devices I have tested, it's been 5 bands). See http://developer.android.com/reference/android/media/audiofx/Equalizer.html
If you want to support equalization on devices before 2.3, or you want to support different frequency bands, or other processing effects, you will have a lot of work ahead of you. Those versions of Android provide no hooks for post-processing of decoded audio. So you'll need to write your own replacement for the native player that gives you those hooks, and then find or write some processing code to do the equalization. If you're looking for a packaged solution in the Android SDK, you won't find it.
精彩评论