FMod - Seamless sound transitions?
BlitzMax Forums/BlitzMax Programming/FMod - Seamless sound transitions?
| ||
| Hi I've just installe FMod and played around with it a little - but it doesn't fit the purpose for which I've installed it yet. The thing is: I've got several songparts and each of them perfectly fits together with each other songpart. I want to mix them up and play them in a random order to achieve having one big dynamic song. The reason why I'm using FMod and not BlitzMax's internal sound is that BlitzMax always leaves a small "gap" between two parts. With FMod, that gap is gone but I've still got a hearable "crack" when finishing one part and starting the next. Here is my code:
SuperStrict
SeedRnd MilliSecs()
Graphics 800, 600, 0, 60
FSOUND_Init(44100, 256, 0)
Global ifmsOne :Int = FSOUND_Stream_Open("Engine-Class4.wav", FSOUND_NORMAL, 0, 0)
Global ifmcOne :Int = -1
Global iPlayTime :Int
Repeat
Cls
If ifmcOne = -1 Or (MilliSecs() - iPlayTime) >= FSOUND_Stream_GetLengthMs(ifmsOne) Or FSOUND_IsPlaying(ifmcOne) = False Then
RestartSound()
End If
Flip
Until KeyHit(KEY_ESCAPE)
FSOUND_Stream_Close(ifmsOne)
FSOUND_Close()
End
Function RestartSound:Byte()
FSOUND_Stream_Stop(ifmsOne)
ifmcOne = FSOUND_Stream_Play(FSOUND_FREE, ifmsOne)
iPlayTime = MilliSecs()
Print ifmcOne
End Function
And here's the soundsample for testing. A simple engineloop: http://www.fetzenet.de/Engine-Class4.wav Also, keep in mind: This is not a looping problem, because I don't want to loop anything. I *have* already discovered the loopingfunctions. |