Audio Crossfading in Android

廉价感情. 提交于 2019-12-04 07:41:07

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).

When second mediaPlayer stars first pauses for while (On some devices mostly on samsung )so transition is not smooth. MediaPlayer has this issue and its been reported to google since long ago but still not resolved(https://issuetracker.google.com/issues/36931073) so we can do nothing about it. So I used Exoplayer for playing audio and it works very smoothly without any pause.

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