Streaming OGG not working in jme3 branch

OGG files loaded with stream=true don’t seem to work currently when looped in jme3 latest SVN revision. I have tried a number of files from different sources and they all play fine with stream=false, but give silence (or occasionally a brief stutter at the start) with stream=true.



Without looping, they play fine.



Simple test case:



[java]

public class StreamingOggTest extends SimpleApplication

{

@Override

public void simpleInitApp()

{

AudioNode music = new AudioNode(assetManager, “res/music/asl.ogg”, true);



music.setLooping(true);

audioRenderer.playSource(music);

}



public static void main(String[] args)

{

StreamingOggTest app = new StreamingOggTest();

app.setShowSettings(false);

app.start();

}

}

[/java]



-davidc

Yep, confirmed. Same here.

I can also confirm the bug mentioned about, looping does work correctly with WAV files.

The way streaming works is by getting an input stream to the audio file and then decoding it dynamically while playing.

Non-streaming sources just have the entire audio data read from the file and then uploaded to the audio engine.



So, due to the way streaming sources work, it is not possible to loop them. There should be an error raised however instead of it silently failing …



I plan to add a listener that would allow you to detect when an audio source finishes playing, then you can re-load it so it starts playing again or you can play a different song (e.g. through a playlist system)

Thanks a lot, that’s good to know!

Thanks, makes sense, and explains why I can’t play them again after they’ve finished (which should probably also raise an exception).



-davidc