Page 1 of 1

Stopping sounds played with "playSound()"?

Posted: Sun Oct 07, 2012 10:40 pm
by Lilltiger
Is there a way to stop a sound that is played using the "playSound()" function, I cant find anything about that in the documentation nor in the forum.

Re: Stopping sounds played with "playSound()"?

Posted: Sun Oct 07, 2012 11:02 pm
by Neikun
redefine the sound and turn loop =false?

Re: Stopping sounds played with "playSound()"?

Posted: Sun Oct 07, 2012 11:16 pm
by Lilltiger
That do not stop the sound, it just stops it from repeating, but if i have a sound that is 4min+ long, but want to stop upon user interaction.

Re: Stopping sounds played with "playSound()"?

Posted: Mon Oct 08, 2012 12:16 am
by Batty
A stopSoundAt(sound, level, x, y) would be great. Even a stopSoundAt(x, y) that just stopped all sounds in x, y would be good.

I've tried several things and can't get sounds to stop.

Re: Stopping sounds played with "playSound()"?

Posted: Mon Oct 08, 2012 12:39 am
by Lilltiger
or stopSound(soundname)

Re: Stopping sounds played with "playSound()"?

Posted: Mon Oct 08, 2012 3:04 am
by Komag
one possibility would be to break up that 4min sound into something like 10 second increments (24 of them) and have a timer set to 9.9 seconds which starts the next segment UNLESS something has happened, in which case the timer won't play the next part. It wouldn't be an exact end to the sound in the right moment, but at least it would end within a few seconds.

Re: Stopping sounds played with "playSound()"?

Posted: Mon Oct 08, 2012 8:24 am
by Lilltiger
I have been thinking about doing it like that, just a lot of extra work