I have had requests from players to have a setting to disable midis or lower their volume without interrupting waves( I use waves for sound effects ). I do not know if it possible to add a volume control for players to control the level of music playing out of byond.
Just so I don't get the replay of "why not just adjust the computer volume" note that this is for either midis or waves so the other plays at full volume while the other is mute or at a lower volume.
ID:133391
![]() Oct 2 2008, 10:58 am
|
|
This is already possible using the sound() process.
Simply give each player a variable that holds their desired volume level, and use that variable to set the volume argument of sound() before playing the song to them. Here's a simple example way of doing it: #define MUSIC_CHANNEL 3 It should be noted that the song volume won't update until a new song is played. To have it update instantly, you'll need to hold onto the sound object returned by sound() and use the status=SOUND_UPDATE setting to resend it at the new volume. |
Dpheonix7 wrote:
I have had requests from players to have a setting to disable midis or lower their volume without interrupting waves( I use waves for sound effects ). I do not know if it possible to add a volume control for players to control the level of music playing out of byond. This sounds like a Developer How-To rather than a BYOND Feature, but is is ostensibly possible to control the volume of played sounds, and even the volume of individual formats. Every sound datum has a volume variable that you can easily modify before outputting to a player, and as for specific formats, you can copytext the portion off the end of the file name to determine its' type. However, this is entirely subject to a simple error -- renaming the file extension. You can rename an MP3 file from "myfile.mp3" to "myfile.ogg", and while programs like Windows Media Player or Winamp won't play it, BYOND will, and that's how most people get away with it. However, if you're not dealing with user-uploaded audio, it's entirely reliable. [Edit: I was beat to everything I said while previewing =D] |
On every sound card I've ever heard of (at least in the last decade), MIDI and wave volume can be adjusted separately, so you don't need to adjust the whole computer's volume.
Lummox JR