The Dink Network

Sound commands in FreeDink

March 4th, 08:33 PM
custom_robj.png
Robj
Jester Male Australia
You feed the madness, and it feeds on you. 
For some reason I cannot get any DinkC commands that kill sound to work in FreeDink 109.6

I ask for anyone's willingness to test and confirm the following:
sound_set_kill(&soundbank);
kill_all_sounds();

These commands appear to do nothing, in any situation, in the latest FreeDink (109.6).
At least, I can't seem to get them to work. Did the commands change or something?

If not, too bad if there's no one around that can, and is willing to fix these again.
March 4th, 09:26 PM
spike.gif
scratcher
Bard Male Finland bloop
cigarette bonca 
Hmm, do you have false expectations from a command called KILLSOUND? IIRC, those commands are only supposed to k[b]</b>ill 'survive' sounds. (ie. Playsound(päläpäläpälä, 1))

To kill a sound right away you had to do something wonky, like assign a variable to it. Maybe even create a sprite and play the sound through that, then kill the sprite to kill the sound, I forget.

Ps. 'smart'phones suck. You' d have to be a moron to write on TDN with one. Or reddit. Or anywhere really. Ducking good for nothing touchscreens.WHY DO PEOPLE TYPE LONG MESSAGES ON THESE IT'S AWFUL
March 4th, 09:47 PM
anon.gif
Robj
Ghost
 
Yep, that's what I mean. I tried the variable way, and tried setting it to survive and then killing it via set_kill_sound.

Tested and works in dink 1.08, but does nothing in freedink 109.6

But in testing I found a crazy bug in the engine that I can't believe people haven't found before, which occured for me in both FreeDink and 1.08.

If you go between two screens via a warp (not a screen change), and both of those screens contains a sprite that has a sound attached, it will do this weird thing where the sounds "merge" together (the sprite with sp_sound will be playing both sounds). I only noticed this when I was testing this further and was going in and out of house... the house had a fireplace playing the fire sound, and outside was a savebot.

Further more, if you constantly go between the screens, the sounds just keep latching onto whatever sprite has a sound set on it, and eventually it'll bank up and run out of soundbank slots (you can tell, when the door warp sound stops working).

The fix is to place a delay of wait(40) on a sprite with a sp_sound set on it, and then it doesn't happen.

Strange.
March 4th, 11:24 PM
custom_robj.png
Robj
Jester Male Australia
You feed the madness, and it feeds on you. 
So yeh, confirmed, FreeDink sound killing commands are broken.. also, sound_set_survive doesn't work if sound is set to repeat, so you gotta set repeat to 0 and loop it manually (just do a loop with a wait for the duration of the audio file).

I came up with work arounds for freedinks sound killing commands being broken for anyone's interested (if anyone even does dmodding anymore):

Create a 1 second silent wav file, name it blank, and force load it over the sound number to stop the previous playing one. It does no harm, I thoroughly tested it.

as for kill all sounds.. you could manage sprite sounds by running some form of loop to retrieve every sprite and check if it has a sound number greater than 0, if it does, set it back to 0 to stop it. Contrary to popular belief, if you are not running an infinite loop (meaning it will have a definite end via incrementing a variable as you check), you don't need a wait, even if it has to check several sprites before it ends - Freedink (unlike 1.08), will process a situation such as this instantly.
March 11th, 09:54 AM
custom_robj.png
Robj
Jester Male Australia
You feed the madness, and it feeds on you. 
sound_set_vol() is also broken.

I got in contact with Beuc and he said it may be a platform dependant issue.
Maybe someone can test it on other platforms?
I'm using Windows 10, and it's buggered.

The only DinkC sound commands that work are:
load_sound()
playsound()
sound_set_survive()

(aside from the usual sp_sound commands, they all work too)