Skip to content Skip to sidebar Skip to footer

Issue With Audio Playback Using Setnextmediaplayer

I need to play an audio without gaps between lopping, the audio needs to be looped forever without gaps. Using setNextMediaPlayer only merge two audio tracks without gaps, after th

Solution 1:

I tried to help a guy do that just a few days ago. See this question.

I'm not sure if he was able to achieve what he wanted, but I believe your problem is that the MediaPlayer is not in the prepared state after the 2nd track finishes. You will need to use the onCompletion listener to return it to the prepared state by calling stop() and prepareAsync(). If it doesn't need to be in the prepared state (I'm honestly not sure), it would be faster to call seekTo(0) from the onCompletion listener.

You will definitely need to uncomment the mp2.setNextMediaPlayer(mp1); line.

Post a Comment for "Issue With Audio Playback Using Setnextmediaplayer"