ID:158905
 
Is it possible to increase and decrease the total % of volume of all sound files playing for a person?

Main gist is I've been working with some sound effects lately, and I'd like to make it so that it's louder outside than it is inside.

Any help would be really awesome. I'm a little out of touch! :-)
The /sound datum has a volume var that you can control the volume of the sound with (you can also specify it from the sound() proc), so yes, you can easily control sound volume for players.
Note you can also play "3D sound", i.e. differently relative to the source of the sound and the player position.
In response to Kaioken
Rhetorically speaking, say we have a file that is repeating over and over. I'm trying to make it so that upon entering a certain area, the repeating file's volume increases (or decreases). How would one go about doing that?

EDIT: Nevermind :)
In response to Nightmare3
usr << sound('boom.wav', volume=50) // play an explosion at half volume


You can control the volume through winget and a slider bar.

mob/verb/Play_Song(F as file)
var/volu = winget(usr,"volume_bar","value")
usr << sound(F,volume=volu)


You could probably do it so that you can change the volume while the song is playing, but I never gave it much thought as to figure out how...
In response to Nightmare3
You can update the same sound by sending the player a new sound with the same file and channel that the original sound had (you have to specify both a file and a channel both times), by using sound.status with the SOUND_UPDATE flag set the 2nd time (as well as whatever parameters you want to update the sound with).
You can use a new /sound object each time if you want, it just has to be with the same file and channel and have SOUND_UPDATE flagged so it updates the current sound instead of replacing it. Here's a code example:
mob/verb/Play_Different_Volume(S as sound)
var/sound/S = new(S,channel=3,volume=33) //create a new sound datum with the wanted parameters
src << S //send the sound - play it
alert(src,"Click OK to play at full volume.")
S.volume = 100 //change to the parameter we want
S.status = SOUND_UPDATE //update an existing sound instead of 'overwriting' it
src << S //send the updated sound.
In response to Howey
I actually got it working a different way. Works good, thanks for your help anyway guys. The slider info was a bit useful for future reference.