[Openal] AL_FORMAT Types and Meanings

Daniel PEACOCK dpeacock at creativelabs.com
Mon Oct 5 05:27:01 PDT 2009





Hi Ümit,

OK - I just wasn't sure what the "for" loop was doing, especially as it
started with an initial value of 0 for channeltype.

In OpenAL a mono wavefile (e.g. AL_FORMAT_MONO16) will be 3D spatialized,
all other formats will be played out of their respective channels.   A
newly created OpenAL Source, with all its default values, will have a mono
sound playing at 0,0,0 which means it will play from all speakers.   You
could give it a 3D position to simulate Front Left location, but it won't
be guaranteed to play from the Front Left speaker only because some 3D
audio rendering techniques involve playing audio from multiple speakers
(e.g cross-talk cancellation).

For your purposes, I think you should use AL_FORMAT_STEREO16 to play audio
destined for the FL or FR channels.

Dan
Creative Labs (UK) Ltd.

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.

Creative Labs UK Ltd company number 2658256 registered in England and Wales
at 79 Knightsbridge, London SW1X 7RB



                                                                           
             Ümit Uzun                                                     
             <umituzun84 at gmail                                             
             .com>                                                      To 
                                       Daniel PEACOCK                      
             10/05/2009 12:08          <dpeacock at creativelabs.com>         
             PM                                                         cc 
                                                                           
                                                                   Subject 
                                       Re: [Openal] AL_FORMAT Types and    
                                       Meanings                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Daniel,

>>Quad = FL FR RL RR
>>5.1 = FL FR FC LFE RL RR

>>Note, that if your end goal is to take 8 mono audio streams and play each
one in 1 of the 8 channels of a 7.1 speaker system, it >>would be much more
optimal to put all the data into a single 7.1 stream rather than having
multiple multi-channel streams each of >>which has most of it's channels
set to silence and just one channel filled with audible samples. It would
also give you the >>advantage of guaranteed synchronous start if that was
important.
My main goal not make unite 8 different sound in one wave file on each
different channel. I give room speaker example to represent my expectation
in simple way. My main goal is to play my mono wave file in different
channels by given specifier. For example, if I give  "1100" specifier for
one sound it will be played for QuadSpeaker and FL, FR channels will be
load others(RL, RR) will be silent.

>>I'm not sure what the second section of code is trying to accomplish.
I have tried implement alBufferData(uiBufferID, eBufferFormat, pData,
iDataSize, iFrequency); in my second part. For example, if my sound 16 bit
sampled sound then,
if(fmt.wBitsPerSample == 16)   // assumes 16-bit short
{     ALshort *data = LoadData((const ALshort*)pData, iDataSize, channels,
channelType); // This line create new buffer in specified size by
channelType for loaded wave.     switch(channelType)     {     ...
    case 4:     alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_QUAD16"),
data, iDataSize * channelType, iFrequency);     break;     ...     }    ...
}
channelType represent my channel count from specified channels variable
which tell framework the sound buffer creation method. For example if
channels : "1100" then channelType = 4 and then case 4: block will be work
for create AL_FORMAT_
QUAD16 typed buffer.

Another question is, if I create my buffer by AL_FORMAT_MONO16, could I
play my mono sound in same way by "10" for play only FL and "01" for FR in
Generic Software? Or Do I have to have Generic Hardware?

I have tried to much explained situtation bu I can't get work on
GenericSoftware for AL_FORMAT_MONO16 buffer to play sound in separated
channels. Do you think I am missing something?

Thank you so much.
Regards.

Ümit Uzun
ForwardSourceID:NT000755BE




More information about the Openal mailing list