johnsonsu/react-native-sound-player

Issue: Can I play multiple songs at the same time? Using many different SoundPlayer?

Closed this issue · 5 comments

Issue: Can I play multiple songs at the same time? Using many different SoundPlayer?

just like this:

import SoundPlayer from 'react-native-sound-player'

const SoundPlayer2 = new SoundPlayer
const SoundPlayer3 = new SoundPlayer

SoundPlayer.playSoundFile('All rise', 'wav')
SoundPlayer2.playSoundFile('Bang_bang_bang', 'wav')
SoundPlayer3.playSoundFile('love_story', 'wav')

Hi @mlop113 No, this library cannot play multiple songs at the same time. The current implementation is similar to a singleton, when a new song is played, the previous instance of player will be either reused or destroyed.

To do what you wanted, we will need a completely new architecture for the library with new usage APIs. I will mark this as enhancement for now, but I cannot give you a date on when I'm able to implement it.

thank you

@mlop113 https://github.com/zmxv/react-native-sound can do this. It has been around for a while now but it works well :)

@RWOverdijk it maybe good with iOS but when I use for android, it load song from url get more time.