Queueing and stopping multiple MIDI files

Started by cat, Sun 17/01/2016 18:02:29

Previous topic - Next topic

cat

Hi!
Not sure if this belongs to beginner or advanced, please move if needed.

I have several music snippets. When I press a play button, I want to have all MIDI files played one after another. I do this with AudioClip.Play for the first and AudioClip.PlayQueued for the rest. This works perfectly fine.

Now I want to have a button to stop the playback. On button click I tried to call Stop() for all AudioChannels in System.AudioChannels. However, this only stops the currently played snipped and automatically starts the next queued one. Is there a possibility to somehow clear the queue?

I managed to stop the playback of all items by playing an empty audio with the same priority when the stop button is clicked.

But is there a better solution than this? Or this reliable enough?

SMF spam blocked by CleanTalk