adrianstevens / Xamarin-Plugins

Cross-platform Plugins for Xamarin, Xamarin.Forms and Windows
https://www.nuget.org/packages/Xam.Plugin.SimpleAudioPlayer/
MIT License
132 stars 53 forks source link

issue playing sound from array of players in loop #100

Open elbonito opened 2 years ago

elbonito commented 2 years ago

have issues playing in loop first 2 playe in array play sound but after no sound i.e. isimpleraudioplayer[] players = new isimpleaudioplayer[12] for(int i = 0; i < 12; i++) { players[i] = CrossSimpleAudioPlayer.CreateSimpleAudioPlayer(); players[i].Loop = false; }

players[0].Load(GetStreamFromFile("pathtofile")); ...... players[11].Load(GetStreamFromFile("pathtofile"));

count=0; ontimer(){ //persecond players[count].play(); if(count ==12)count=0; } and every cycle doesnt matter where i start the array of players like set count to 5, it will only play the sound from 2.

elbonito commented 2 years ago

playing multiple sounds simultaneously seems to work in android emulator, but having issues in uwp.. will test in ios soon.. same code as above.