How to synchronize audio playback in Android?

I am writing my first Android application, trying to play two 10-minute audio files in sync (imagine an instrumental track and acapella) to be able to change the volume of each track independently). I use two MediaPlayers for this, as SoundPool aims at shorter sound samples as far as I read.

Now my problem is that when pausing and resuming playback, sometimes the players are no longer synchronized, although I again set my positions to the same value before resuming playback.

I know that this is inevitable, because they cannot start at exactly the same moment, and they may need a different amount of time to start playback, but: Maybe there is some other approach to satisfy my requirements?

+4
source share
1 answer

You can take a look at JetPlayer , this can accomplish what you want as you synchronize.

To use it, you create audio channels (your instrument channel and vocal channel) as MIDI files on a track, and the player can synchronize them, allowing you to mute or mute various channels as needed.

A user guide for creating JET resources can be found here .

+1
source

All Articles