adrianstevens / Xamarin-Plugins

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

[iOS] iOS crashes on the play and the prepare method when simultaneous sounds are playing #47

Closed JTOne123 closed 5 years ago

JTOne123 commented 5 years ago

I got several crashes after my try to start and play a few sounds at the same time.

It works well on Android and UWP, but not on iOS.

I cannot catch the exception, because they happen somewhere in a kernel.

Here are crash logs

prepare image

play image

I play my sound in this way

if (audioPlayer.Load(ResourceLoader.GetEmbeddedResourceStream(ResourceLoader.Assembly, fileName))) { audioPlayer.Play(); }

What I'm doing wrong? How correct way to play sounds in parallel?

adrianstevens commented 5 years ago

You'll need a separate instance of SimpleAudioPlayer for each sound - are you using multiple or sharing a single instance?

JTOne123 commented 5 years ago

yep, I did it in this way Thank you for answer