Audio on Android - Looping

The way the current android audio renderer loads the files is not really compatible with the assetmanager system of jme3 at the moment but as @nehon says, it should work when the file gets packed in the apk (right?).

Hi @normen, @nehon I have attached the files like you said /assets/…



and referenced them in JME as assets/…



Still no luck. Only Textures work for me.

I take it I am having the same issue as these guys?



http://hub.jmonkeyengine.org/groups/sound/forum/topic/problem-with-ogg-vorbis-music-file-and-android-deployment/



http://hub.jmonkeyengine.org/groups/android/forum/topic/sound-file-not-found/?#post-167685



Will this be fixed or should we use the workaround for this (having the sound files outside of assets.jar?) or is this already fixed?



Thanks

This is not fixed, because there is no way to open an audio file as a stream on android.

Only solution would be to use openSl but it’s only supported on version 2.3.

So right now use the workaround.

You can have the build copy the files for you in the correct folder and it will be seamless for you.

about the original thread subject: sounds are looping;



line 415 in AndroidAudioRenderer:



[java]private void setSourceParams(AudioNode src, MediaPlayer mp) {

mp.setLooping(true);

mp.setVolume(src.getVolume(), src.getVolume());

//src.getDryFilter();

}[/java]





change it to:



[java] private void setSourceParams(AudioNode src, MediaPlayer mp) {

mp.setLooping(src.isLooping());

mp.setVolume(src.getVolume(), src.getVolume());

//src.getDryFilter();

}[/java]:



Kine

erf…my bad…that’s a change i made for testing and never reverted it back. sorry i’ll fix it asap.

That’s fixed

1 Like