ID:162813
![]() Nov 23 2007, 3:34 pm
|
|
I know there is a way to change the volume of a mid or wav file that is played through byond, When first playing it. But is it possible to alter the volume of a midi or wav while its being played? Like.. If somthing was to happen during the game and i want background music to become lower so other sounds can be heard, Can i do this without restarting the file? Thnx.
|
Nah no good, I dont believe its possible... :/. Wich sucks, Ive recently made a demo that allows mp3s to be played via html through the client.. Im thinking there may be a way to use that for the music, and maybe a way to edit volume using html, Know any html for media players embeded? :P.
|
Make your changes to the sound datum. Set its status to SOUND_UPDATE. Send the sound datum to the listeners again.
|
Ah your right, Just read it in the guide what its used for. But im kinda not sure how to add it in coding, Is it used as a proc, or hows that work? xD.
|
mob/Login() Resets the sound but at a lower volume, WHatd i do worng? :P. Thnx for having patience with me xD. |
Ah, we forgot the channel. The help file says to specify it. It's the fourth argument in the sound() proc.
By default, it's 0, which means that it takes a somewhat random free channel. When you send it again with the 0, it may be confused about which channel to update. A least, that's my theory at the moment. ;) (I did this sort of thing with Crass Grave, but it's been a while.) |
Though I've never used it, there is a sound datum that you might be able to take advantage of here. This isn't tested, but you might be able to do something like this...
I'm not sure if changing the sound's variables while it is playing works like that, but you could give it a shot just in case -- I've never really used many sounds in my projects.