[Openal] Some frustrations with openAL sample code

Scott Mayo scottm at obsessionaudio.com
Fri Feb 29 06:22:52 PST 2008


I'm new to openAL, but not to C++. I grabbed the openAL 1.1 SDK and was
pleased when the samples directory had projects I could build with Dev
Studio on Windows. That's always a good sign.

Then I saw the code. 

Frameworks.cpp

			ALchar ch = _getch();
			i = atoi(&ch);
If you don't immediately know why that's unsafe, you shouldn't be writing
example code.

ALFWprintf. It's printf. printf is part of the language standard. Why does
this even exist?

CWaves.cpp. 

GetWaveALBufferFormat - blindly assumed that mono wav files must be either 8
or 16 bits deep. So it worked with the test .wav file the example came with.
I replaced the test .wav with another one, which (unknown to me) was mono at
24 bits. It played it as if it as 16; ie, I got a hideous burst of dirty
white noise, instead of a violin. If that had blown my speakers...

Overall, the code needed to be refactored and error checked before it was
general enough to use to write code with. It had clearly been written with
one goal: make the example, and only the example, work. Change anything and
all bets were off.

And the crowning glory: Vista's been out for over a year, but openAL isn't
capable of doing anything but 2 channel work with the only option available
to me, the Generic Software renderer. I spent a day beating my head against
a poorly documented wall, trying to figure out why I couldn't position sound
to the rear channels. 

I'm lost. The release date of Vista was over a year ago. And I have to
believe openAL folk would have been told before that, that openAL was going
to become the only option for multiple channel processing on Vista. Yet...
13 months later, I don't have out of the box, openAL solution for
multichannel sound. I should have been up and running in 2 hours with freely
positionable sounds. Instead, a few days later, I don't have positionable
sounds at all, except for Left/Right. I could do better than that in 1980,
with DEC mainframes and assembler.

So I'm asking the user community 1) if openAL has always been this way, and
how it got to be some sort of standard if it did, 2) if I have other options
for multichannel  (I'm stuck with Vista) and 3) if I'm stuck with openAL,
how the heck do you get it to do basic, multichannel streaming? Do I HAVE to
by a Creative sound device? If I do, will it actually work? 

Very, very frustrated.
-- 
View this message in context: http://www.nabble.com/Some-frustrations-with-openAL-sample-code-tp15759360p15759360.html
Sent from the OpenAL - User mailing list archive at Nabble.com.



More information about the Openal mailing list