• fade music in/out
    4 replies, posted
how would i fade a sound file out or in? without editing the sound file itself of course.
Can you give more detail? Are you playing the sound locally on the client? Using what code?
You're going to want to checkout [URL="http://wiki.garrysmod.com/page/sound/PlayURL"]sound.PlayURL[/URL] and [URL="http://wiki.garrysmod.com/page/sound/PlayFile"]sound.PlayFile[/URL]. Then use the [URL="http://wiki.garrysmod.com/page/Category:IGModAudioChannel"]AudioChannel[/URL] (returned in the callback ) to determine the length of the sound and adjust the volume according to place in the sound (you could probably just use a timer, but you can likely find a better solution).
[QUOTE=demogod;47929646]You're going to want to checkout [URL="http://wiki.garrysmod.com/page/sound/PlayURL"]sound.PlayURL[/URL] and [URL="http://wiki.garrysmod.com/page/sound/PlayFile"]sound.PlayFile[/URL]. Then use the [URL="http://wiki.garrysmod.com/page/Category:IGModAudioChannel"]AudioChannel[/URL] (returned in the callback ) to determine the length of the sound and adjust the volume according to place in the sound (you could probably just use a timer, but you can likely find a better solution).[/QUOTE] The fading would happen when something in the game happens, so timers won't work because it wouldn't be the same every time.
Can't you just use a hook, then?
Sorry, you need to Log In to post a reply to this thread.