Yet Another PlaySound() Question

When I run the following code,

		_, soundHandle = PlaySound ( SOUNDKIT.READY_CHECK )

from my addon, the sound repeats itself over and over again. I would like to get it to run just once. However, when I run the function from a macro, i.e.,

/run PlaySound( SOUNDKIT.READY_CHECK )

It works just fine. I’ve tried using the optional args to the PlaySound() function and none of the combinations have proven successful.

I’ve also tried using

StopSound( soundHandle, 2000 )

Where soundHandle is the second arg returned from PlaySound() and 2000 is the number of milliseconds the sound is to play, all to no avail.

I’m sure this is something simple and I’m just missing something obvious. Any advice would be very much appreciated.

Cheers

Since putting that first line into a script causes it to only play once, I can only assume that your addon is calling the line continuously. This would also cause stopsound to do nothing, as playsound just gets called again. How do you have it set up in your addon?