sanakanchha
sanakanchha

Reputation: 1

how to play different songs on left and right channels simultaneously on android device

Is it possible to play 2 different songs simultaneously on the left and the right channel on android device? I searched a lot to see if MediaPlayer class provides APIs to support that but in vain.

SoundPool has the file size restriction and I need to play files larger than 2 MB. Basically, I have a android player which plays single zone. Now I need the player to play 2 different songs simultaneously on the left and right output (speakers/earphone etc.) Is this possible? Any help is greatly appreciated.

Upvotes: 0

Views: 1569

Answers (1)

MikeHelland
MikeHelland

Reputation: 1159

Use two instances of AudioTrack.

I create plenty of them.

Usually devices let you go up to 24 or so.

All you need is two :-)

android play sound with AudioTrack

The setVolume() method takes two parameters, one for left, one for right.

Upvotes: 1

Related Questions