Fwd: [Openal] AL_FORMAT Types and Meanings

Ümit Uzun umituzun84 at gmail.com
Mon Oct 5 04:09:45 PDT 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20091005/b1e526d5/attachment.html


More information about the Openal mailing list