PDA

View Full Version : What is easiest cross-platform way to play .ogg files with OpenAL (Win32/Linux/...)?



paul_nicholls
23-12-2011, 10:55 AM
Hey all,
I am already using OpenAL in my game, The Probe, but now I want to play .ogg music files as well as the .wav sound effects that I already play.

What would be the easiest, and lowest dependancy way of playing .ogg files using OpenAL that will work cross-platform (Win32/Linux/...)?

Any ideas?

cheers,
Paul

Andru
23-12-2011, 12:00 PM
how many libraries do you know? Vorbis (http://www.xiph.org/downloads/)(you need libogg and libvorbis) as a reference realization :) And one of the fastest for ARM realization - Tremolo (http://wss.co.uk/pinknoise/tremolo/).

paul_nicholls
23-12-2011, 08:47 PM
Hi Andru,
I have used one or two ogg and vorbis DLLs before to stream ogg files using OpenAL in the past (was a bit buggy though), but I was hoping to use some solution that doesn't need yet more DLL/SO files to distribute (or install) with my game...C/C++ seems to be able to play ogg files without extra libs due to just compiling the libs into the exe.

I don't think I can do this with Freepascal/Delphi?

I already have the sdl.dll, openal.dll, and my game engine dll...

EDIT: what sort of music files can ZenGL play?

cheers,
Paul

Andru
24-12-2011, 05:09 AM
ZenGL can stream ogg music. And it uses libraries which I mentioned. With FreePascal you can use static linking without dll's. Delphi... you can try to use object files from ogg libs after compilation with Borland C++, but I had no luck.

paul_nicholls
25-12-2011, 09:28 AM
ZenGL can stream ogg music. And it uses libraries which I mentioned. With FreePascal you can use static linking without dll's. Delphi... you can try to use object files from ogg libs after compilation with Borland C++, but I had no luck.

Hi Andru, I have downloaded libogg 1.3.0 and libvorbis 1.3.2, and both seem to come with source code...so I was wondering what I might be able to compile them with to produce statically linking libs/whatever for freepascal then? (I guess I can always give up on Delphi for compiling my game and just use Lazarus)

Any idea if code::blocks (http://www.codeblocks.org/) might work?

cheers,
Paul

Andru
26-12-2011, 07:31 AM
Any idea if code::blocks might work?
Yes, it will, but you will be needed to create proper project file with all options... :) But even so - static compilation won't be easy for Windows. See source code of ZenGL - zgl_sound_ogg.pas (http://zengl.googlecode.com/svn/trunk/src/zgl_sound_ogg.pas) and zgl_lib_msvcrt.pas (http://zengl.googlecode.com/svn/trunk/src/zgl_lib_msvcrt.pas).

paul_nicholls
26-12-2011, 09:47 AM
Yes, it will, but you will be needed to create proper project file with all options... :) But even so - static compilation won't be easy for Windows. See source code of ZenGL - zgl_sound_ogg.pas (http://zgl_sound_ogg.pas) and zgl_lib_msvcrt.pas (http://zgl_lib_msvcrt.pas).

Thanks, I will take a look :)