The way to do this is to call loader.loadSfx() multiple times with the same filename. After the first time, it should return the same sound image from the internal cache, without actually reading the file again from the disk.
Each time you call loadSfx() on a given filename, you get a separate handle to the sound image that you can play independently of all the rest of the handles to the same sound image.
Is there a way to give a sign back to the main routine if a sound is played?
I am reading through the API reference manual but I am getting a bit lost there because you have no detailed search there… I have some of the methods, yes (like setVolume) but where do I get the WHOLE thing? I tried to search for “base” but there are a million things with that name in the ARM - and I looked for “loadMusic” to find a hint where to search in detail, but it doesn’t show the real needed name
Can you please tell me how I can get ALL “supported” commands of a module (in other words here: where to search for “base” to find all information about it?)?
The problem I have had is the fact that the .play()-command does not give a sign when it finishes playing… the easiest way to get a signal is using:
import time
self.musicFileTime = self.musicBoxSound.length() # for example - however you called
#it. I use the example from the docs
time.sleep (self.musicFileTime)
That stops the thread for exact that ammount of time and continues then with whatever code you give 'em
May be that you guru’s don’t need that help, but it was a hour’s work to get enough informations that led me to help (time.sleep) - and I guess there are more than one programmer that does his own first steps in the programming thing as a whole new universe
Rrrriiiiight… but I guess its nothing else at the end… plus: I wasn’t at “tasks” in the manual (nor am I now due to slow translation) - I took a look at it and yes, of course, it would work also.
Thx Sandman
PS: Uh, and you need to import and run the taskMgr, I guess?
virtual void AudioSound::set_finished_event(basic_string< char > const &event) = 0;
// Set (or clear) the event that will be thrown when the sound
// finishes playing. To clear the event, pass an empty string.
looks like it would do what you need, send an event when sound is finished…