How to stop the previous sound which created by the same system?

(Tony) #1

The question is:
I create a sound with a system instance,and the sound is playing, meanwhile I want to create and play a new sound with the previous system,so I call system->close() and system->release() to stop the previous sound,but the program crash imediately.It seems that if a sound didn’t finish its playing,system->close() and system->release() can’t be called to stop it and play the new sound? How to solve this?

Thanks in advance.

(Cameron Baron) #2

You should only have one instance of the system, that you can then create and play sounds with, unless it is for a specific purpose.
Closing the output renders objects created with this system object invalid, so make sure to release everything before.

If you want to destroy the system and everything in it, system->release() calls close so it is not necessary for you to.

(Tony) #3

helps me a lot.Thanks for you reply.