Re: GLMediaPlayer not playing short MP3 files
Posted by
gouessej on
Jan 22, 2015; 10:39am
URL: https://forum.jogamp.org/GLMediaPlayer-not-playing-short-MP3-files-tp4033889p4033893.html
I succeed in reading sounds from files not in JAR files. I call SoundSystem.loadSound(URL), I obtain the URL by calling Class.getResource(String). You can call java.io.File.toURI().toURL(). It reminds me that I have forgotten to remove LibraryJavaSound.jar from my project as I only use CodecJOrbis.jar, LibraryJOAL.jar and SoundSystem.jar + JOAL itself.
You need this to initialize this library:
soundSystem=new SoundSystem(LibraryJOAL.class);
SoundSystemConfig.setCodec("ogg",CodecJOrbis.class);
Paul Lamb Sound Library is used in Minecraft, it's rock solid. I suggest its use in your case because in my humble opinion, it's weird to use video playback just to play a MP3 sound.
If you prefer using FFMPEGMediaPlayer, I can do nothing for you and maybe there are some bugs :s