ID:140565
 
Code:
mob
var
sound/sound = 'petrol.wav'

Login()
..()
src.sound = sound(src.sound)
src.sound.repeat = 1
src.sound.channel = 1
src << src.sound

proc/UpdateSound(velocity)

src.sound.frequency = 0.5
src.sound.status |= SOUND_UPDATE
src << src.sound


Problem description:
Okay, so the way this is setup it should start the sound playing repeatedly on channel 1 as soon as the player logs in. Then, whenever UpdateSound() is called, it should change the frequency of the sound to 0.5, which should effectively make the sound start playing at half the speed. Instead, it just makes the sound stop.

Am I doing something wrong here, or is this a bug, or does BYOND simply not support changing sound frequency at runtime?
The sound code seems to suggest this should be working. I haven't run a test myself, so it's possible that it's just your card and on certain sound cards updating a sound mid-play might not work. But your code looks kosher.

Lummox JR
In response to Lummox JR (#1)
Okay, I've changed things around a bit and the previous problem has gone away, although I'm still not sure why it was happening or what part of the code exactly was causing it, yet. However, I'm looking at another problem - which I'm not sure is actually a problem. Is this the intended behavior?

mob
var
soundFile = 'petrol.wav'
sound/sound

Login()
..()
src.sound = sound(src.soundFile, repeat=1, channel=1, volume=10)
src << src.sound

proc/UpdateSound(velocity)
src.sound.frequency = 1.1
src.sound.status |= SOUND_UPDATE
src << src.sound


Whenever it called UpdateSound(), it increases the frequency of the sound by 110%. It doesn't SET the sound's frequency to 110%, it increases it. Its the equivalent of my writing:

sound.frequency *= 1.1

Is that really intended behavior? It would be much, MUCH simpler to have it just play at the frequency specified. Now I'll have to create a separate variable to keep track of what frequency the sound was set to last so that I can calculate what value to multiple it by to get the frequency that I actually want it to be at.