ID:1793429
 
(See the best response by Fushimi.)
Code:
for(var/sound/s in player)
if(s.file=='secretSong.wav')
del s


Problem description:I was hoping i could do something like this. Can I do something similair?

Are you trying to delete a file? If so use the fdel proc.
Best response
There are workarounds to do such thing, but you would need to keep track of what channel is the song playing it:

#define EFFECTS_CHANNEL 15
#define MUSIC_CHANNEL 5

proc/sendSound(client/client, sound/sound, channel = 0)
if(!client || !sound)return 0
sound = sound(sound)
sound.channel = channel
client << sound

proc/clearChannel(client/client, _chann = 0)
if(!client) return 0
client << sound(null, channel = _chann)


This way you can set up as many channels as you like, and keep track of specific sounds you would want to remove.

However, I have a snippet that handles Sound effects very well, you might want to take a look at it as it is efficient.

However, if you are only going to handle a handful of sounds, the approach debscribed here may fit your needs better.

The engine can be found here: http://www.byond.com/forum/?post=1766867


@Mar big: He is tryng to stop a sound that is already playing.
In response to Fushimi
sweet, ill see what i get when i have the time to work with it, but thats the sorta thing i was looking for. Only need to remove 1 sound/song at a time at most with what I am doing