I need to loop fairly short sounds (in wav format preferably, but that can change) and would prefer to use "create3dSample" instead of createStream, mostly because streaming introduces a bit of a blank delay which destroys the effect. (this is a rocket engine sound)
Is this possible?
Also, is there a way to change the frequency of a looped sound on the fly? (think throttling)
Thanks 4 any pointers.
aokjoey
I know in the book "Developing Games in Java" by David Brackeen he has a chapter or two on creating a sound filtering architecture and shows examples of fading sounds or creating echos and various other effects. There may be some information in there to help you get started on creating a pitch-based filter.
I heard of a technique where you mixed two sounds of different frequency and that produced a similar effect. That's probably what I'll do.
I still need to find a way of looping without that stupid sound gap.
Thanks!
Book had samples on how to loop sounds as well. I built a sound engine based on the code in the book (about 3 years ago) and it looped sounds quite well. I had a background engine "hum" for a starship that looped seamlessly on that engine.
Okay, I found a way to do it. The org.lwjgl.openal.AL10 package has a routine (alSourcei) to set options like looping, so…
I added the following to Sample3D.java in com.jmex.sound.openAL.objects:
public boolean playLooping(){
That should already be in the newer audio package (jmex.audio) If you could try that and tell me your results, I'd be grateful.
I actually looked at that first, but the examples were all spatially-oriented stuff. I don't need that at all.
If I can do the sound in a similar manner as SoundSystem (without the tracks and paraphalia), I'd gladly give it a wack.
aokjoey