[Openal] ALUT import for different wav formats

Jason Daly jdaly at ist.ucf.edu
Fri Sep 7 11:15:17 PDT 2007


developer at oldunreal.com wrote:

> ok, another few questions then :P
>
> What tool did you use to find out the format? Would make it more easy
> for me to identify such things problems, since this isn't the first time
> i ran into this trouble.

Not sure if it'll help, but I just used the "file" command from a Linux 
shell :-)

If you're on Windows, I'm sure there's some freeware program out there 
that will let you inspect RIFF header information (or you could install 
Cygwin).


> But what still is kinda weird then, why did it work with the old void
> alutLoadWAVMemory then?

I don't know.  The old ALUT code was different on each platform that it 
was written for.  The new "freealut" is a common code base (and a lot 
cleaner).


> Anyway, I checked libsnd now deeper, and aside the fact that I have real
> problems with all the digital audio stuff I'm not aware of, it more and
> more seems a bit overkill for this purpose :(
> I'll keep working on it, but hell...
>
> Does anyone know another lib i could use instead of alut to make sure
> that wav formats like the one above can be loaded with a simple
> interface like alut?

libaudiofile might not be a bad choice.  Not sure it'll support MP3 
though...


> Problem is, I can't control which formats were build in the different
> maps or mods in the game I'm writing this for :(, so I have to take care
> that as many different formats as possible are supported.

If you want to be absolutely sure (and you're only dealing with .wav 
files), it's not all that hard to read the RIFF header info yourself, 
and have a different code path for each format that you care about (alut 
for PCM and u-Law, libvorbis for Vorbis, libmp3lame for MP3, etc).  I 
can send some code off-list if you like (let me know).

-- 

--"J"

"I'm a castaway stranded in a desolate land,
 I can see the footprints in the virtual sand."
	--Neil Peart



More information about the Openal mailing list