Search code examples
androidaudiomp3media-player

Audio Crossfading in Android


I am develping a media player for my learning purpose and I want to have crossfading feature in media player app. But I don't have clue where to start from. i tried searching on inernet but no luck. I am using Android MediaPlayer class for all media player related operation. Anyone know any workaround to achieve the same.

thanks for your support


Solution

  • Try to use the AudioTrack instead of MediaPlayer. Generally, I'd suggest the following plan:

    • Learn some sources for an app that uses AudioTrack. A good player can be found here

    This is an aac audio player that uses JNI for aac-audio decoding.

    • Find a MP3 decoding library. The library should be a Java one (look at this for example, or it is possible there are another libraries (I did not use such java libraries)) or a C/C++ library (in this case you also will use it through JNI).
    • When you will get simple working MP3 player, add manual crossfading (this should be easy, if you aware of basics of digital audio).