jfversluis / Plugin.Maui.Audio

Plugin.Maui.Audio provides the ability to play audio inside a .NET MAUI application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i stop previous audioPlayer before creating new one ?

comm-amir-david opened this issue · comments

i need two function one is to stop previous audioPlayer before creating new one and playing it.
other is to finish current playing audio then create a new one and play it.

the problem that there is no load option inside AudioPlayer and i must create new instant every time i need to play a audio ??

the problem that there is no load option inside AudioPlayer and i must create new instant every time i need to play a audio ??

This is by design. AudioPlayer is immutable so you can't load in different audio files. You can create as many players as you like and start/stop then when you like

this will not create a memory leak ?

Having multiple players created will consume more memory but you shouldn't experience any leaking so long as you don't continue to hold a reference to them once you have finished. They implement IDisposable so you have the power to tidy them up

No response anymore so assuming this is handled. Thanks!