ID:269705
 
Basically I have a midi file in the background and have a sand storm wav file looping. I want to stop the sand storm sound and keep the midi file going. How would i do this?
If you supply a specific channel for the sand storm when you play it, you can cancel it by playing null on the same channel.
mob/proc
Sandstorm()
// play the sandstorm on channel 7
src << sound('sandstorm.wav',,, 7)
EndSandstorm()
src << sound(null,,, 7)

You can stop all currently playing sounds but leave midis and songs running, by playing null on channel -2. Channel -1 stops songs and channel 0 stops all sound.
    silence_sound()
set desc = "Turn off all currently playing samples."
src << sound(null,,, -2)

silence_music()
set desc = "Turn off all currently playing songs."
src << sound(null,,, -1)

silence_all()
set desc = "Turn off all currently playing sound."
src << sound(null,,, 0)
In response to Shadowdarke
Thank you shadowDarke,I know this response was for whoever started this thread but what you just posted is something I honestly didnt know
(I never knew sound took the integers [-2] and [-1] as parameters)


Itanium
In response to Itanium
Glad to help. Sound will have more complete documentation with all the new features coming out soon. :)