First off, I want to express my deep appreciation to you (Paul) for not only writing this code and making it available, but also for the well-written documentation. I just finished reading “3D Sound with SoundSystem” and am gung-ho to give the library a try with my puzzle game http://www.java-gaming.org/index.php/topic,23676.0.html which badly needs the ability to use compressed sound resources.
One of the things I intend to do is to loop a continuously-sounding (no silent spots) background of about 30 seconds. However, instead of a direct end-to-end connection for the looping, I intend a slight overlap of approximately a quarter second. The sound was recorded with endpoint fades with this usage in mind. A crossfade overlap minimizes the chance of an audible click or glitch in the sound marking the looping point.
I thought I’d check first to see (1) if you had already implemented something along these lines; and (2) if I succeeded in creating a “simple” version, would it be a useful addition? The function would consume, at the least, for the moment of overlap, two streaming channels. The command might be something along these lines:
mySoundSystem.backgroundOverlap(“Ambient 1”, “ambientPad.ogg”, startOverlapTime [, fadeTime])
Thus, if ambientPad.ogg takes 30 seconds, the startOverlapTime might be set to 29800 msec and the fadeTime might be 200 msec. From 29800 to 30000, the first instance of ambientPad.ogg would be attenuated and reset and a second instance would be faded in. Then, after another 29800 msec, the second instance starts fading out and the first instance restarts with a fade in, the cross fade again taking 200 msec.
The alternative form (omitting the optional fadeTime), would simply start the second instance at the designated time and allow the first instance to end naturally, alternating as before. This form could be used by people who have already built fades into their sounds.
What do you think? I’m quite open to suggestions! I did this in Hexara with .wav “Clip” objects in the javax.sound.sample library. I’m hoping to recreate this with your library, taking advantage of the OGG playback.