ID:1252076
 
Keywords: channel, music, sound, volume
BYOND Version:498
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Internet Explorer 7.0
Applies to:Dream Daemon
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
Hello! I am having a problem where when a sound plays (namely music) it will play in the wrong channel and have the wrong volume when there is lag in game online. It can lag when loading background music, but when I play offline it is fine even if it does lag.

This is a problem because I have a specific channel for music, and it can overlap when this happens and sound strange!

Numbered Steps to Reproduce Problem:
Play a large sound file (about 1mb) that people have not loaded yet and it will lag them and play on the wrong channel and wrong volume.

Expected Results:
I wished to use a specific channel for music so when another one plays, the one currently playing will stop.

Actual Results:
Music plays on different channels simultaneously and is strange. Sometimes the music can end up very loud!

Does the problem occur:
Every time? Or how often? Most of the time
In other games? In my other games
On other computers? Yes

When does the problem NOT occur?
When a sound is loaded before and does cause lag.

Workarounds:
I could have everytime have all sound cuttoff each time a new song is played, but then I will have to re-play other repeating sounds such as ambient noises!
Post the code so everyone can be sure that it's Dream Seeker and not your programming that's causing this problem.
Oh okay, here is when you log in
    Login()
..()

if(BGM_On == 1)
spawn(2)
var/tmp/sound/S = sound("[BGM_file]",1,channel = 499,volume = BGM_vol)
usr << S


This is for when the music changes when a boss sees you
        get_target()
for(var/mob/m in oview(11, src))
if(m.player == 1 && m.down == 0)
target = m
if(src.spotted_players == 0)
src.spotted_players = 1
for(var/mob/pc/M in world)
if(M.FRplayer == 1)
M.AbleToBTHQ = 0
//When the boss sees someone it changes the music
M.ChangeBGM(M, "BGM/Zelda Minish Cap - Boss.ogg", 55)
return


And this is the proc thats called up there
        ChangeBGM(mob/P, file, volume)
P.BGM_file = file
P.BGM_vol = volume
if(P.BGM_On == 1)
var/tmp/sound/S = sound("[P.BGM_file]",1,channel = 499,volume = P.BGM_vol)
P << S


I'm not sure its my code, I handle all BGM stuff with that proc, but just sometimes online it messes up.