jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.81k stars 1.12k forks source link

Use jme3-jogg for loading ogg files on android #1960

Closed Ali-RS closed 1 year ago

Ali-RS commented 1 year ago

jme3-jogg uses a pure java decoder and supports streamCache which is not supported by android native vorbis loader, afaik. I tried jme3-jogg on android and it seems to work fine.

This will make both desktop and android use the same API and because it is a pure java implementation the maintenance should be much easier.

The goal is not to remove or deprecate the existing android native vorbis loader. Also, this is not aimed for JME v3.6.

Ali-RS commented 1 year ago

I noticed an important limitation of android NativeVorbisLoader is that it cannot load audio files from classpath.

https://github.com/jMonkeyEngine/jmonkeyengine/blob/0cb5fe755582d776ddf223ce88771d958f4818cf/jme3-android/src/main/java/com/jme3/audio/plugins/NativeVorbisLoader.java#L154