I’m programming with a Basic-based, modular "C-Wrapper"-language called "BlitzMax" and just started using an FMod-Module – however, this issue / question is NOT language-related.
I’ve just installed 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 sounddriver/routines 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. This "crack" does not occur if I loop the sound, then it’s perfectly fine – but unfortunately looping is not an option here as you might have figured out yourself.
So.. how can I solve this problem? Is there a possibility of adding one stream to the end of another (while playing the one to add the second one to!), somehow fusing them?
Or, alternatively, are there other options to achieve what I’m trying to?
Here is my code. It’s BlitzMax, though, but I think, basic can be understood by every programmer:
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
If ifmcOne = -1 Or (MilliSecs() - iPlayTime) >= FSOUND_Stream_GetLengthMs(ifmsOne) Or FSOUND_IsPlaying(ifmcOne) = False Then RestartSound() End If Flip
ifmcOne = FSOUND_Stream_Play(FSOUND_FREE, ifmsOne)
iPlayTime = MilliSecs()
And this is the soundsample I’m testing the coe with. Just a loopable enginesound I’ve grabbed from a game for testing purposes – because then I can be absolutely sure that it really IS looping seamlessly when played correctly.
- Fetze asked 10 years ago
All you are doing is starting a new sound at an arbitrary time, that is not the way to get a gapless join.
All i can suggest is use crossfading instead and start the new sound a few hundred ms before the first one stops, or use FMOD Ex and its stitching/sentencing feature with Sound::setSubSoundSentence.
Hm, well.. crossfading is not the way to do it here, because it doen’t really fit into the song. I’ve already tried that with a 50 ms-crossfade.
So, FModEx can do that? Hm.. there is no FModEx-Module for BlitzMax at the moment, but I’ll keep the eyes open for one.
Anyway – right now I seem to have to do without seamless song-joining.
- Fetze answered 9 years ago
Please login first to submit.