Fading out audio?

BlitzMax Forums/BlitzMax Programming/Fading out audio?

Bukky(Posted 2006) [#1]
Hey guys,

Is there a method for fading out an audio track?


Eikon(Posted 2006) [#2]
Something like this
chan:TChannel = AllocChannel()
mySfx:TSound = LoadSound("song3.ogg")
chan = PlaySound(mySfx)

tmpVol# = 1
Repeat
	If MilliSecs() >= fadeTime + 100 Then
    	     SetChannelVolume chan, tmpVol
     	     tmpVol:-.02
	     fadeTime = MilliSecs()
	EndIf
	
Delay 10
Until KeyDown(KEY_ESCAPE) Or tmpVol <= 0



CASO(Posted 2006) [#3]
How would a program be able to find the duration of an audio file?