Hi all.
I’m considering using joal for the game I’m working on.
I want to use .ogg audio files, but I don’t know how to play such files using joal…
Could you give me any help please?
Hi all.
I’m considering using joal for the game I’m working on.
I want to use .ogg audio files, but I don’t know how to play such files using joal…
Could you give me any help please?
Following-on from the 7 OpenAL tutorials linked to from the JOAL page, there is a ‘secret’ 8th lesson which hasn’t been converted to Java. This 8th lesson deals with streaming of OggVorbis files. If you can bear converting it from C++ to Java in your head, then it might be worth looking into.
http://www.devmaster.net/articles/openal-tutorials/lesson8.php
Otherwise, I’d a search for a description of the Ogg Vorbis file format (seeing as it’s a royalty-free format, this information should be out there), preferably one which tells you the format of the header and how to go about decoding the sound data located in the body of the file. Given the relative popularity of the Ogg file format, someone may have already written a free-to-borrow Ogg file decoder in Java which you can use.
Either way, once you have the decoded sound data, shove that into a ByteBuffer, load it into OpenAL in much the same manner as given in the other 7 tutorials (genBuffers -> bufferData -> genSources -> playSource), and the rest is history
Thanks for your answer.
I’ve already looked at this 8th C++ lesson, I’ve also considered porting it to Java, but the C++ code refers to “OggVorbis_File oggStream; // stream handle”.
I don’t know what it refers to using Java, if someone has any idea, this would be very helpful
Should I use Tom’s OggInputStream?
If I find out any solution I will release the source code
Thanks again
it’s a struct defined in the project, check out vorbisfile.h
in any case, if someone has converted this to Java, i’d like to find it as well
I’m a little rusty with C++ and don’t want to reinvent the wheel either
nevermind, it’s here on the site! i didn’t see it because it’s not in the tutorial bundle.