AL_FORMAT Types and Meanings

View: New views
6 Messages — Rating Filter:   Alert me  

AL_FORMAT Types and Meanings

by Ümit Uzun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi All,

I have needed to control every channel manually so I have injected Framework.cpp of OpenAL SDK.
I added

template<typename T> T *LoadData(const T *data, int size, const char *channels, short channelType)
{
    size /= sizeof(T);

    T *multData = new T[size * channelType];

    for(int i = 0; i < size; i++)
    {
        for(int k = 0; k < channelType; k++)
        {
            multData[i * channelType + k] = channels[k] == '1' ? data[i] : 0;
        }
    }

    return multData;
}

const char *channels; // For example 110010
// Find channelType by counting channels value for example 5.1's channelType == 6
short channelType;
for(channelType = 0; channels[channelType] != NULL; channelType++);
if(fmt.wBitsPerSample == 16)   // assumes 16-bit short
{
    ALshort *data = LoadData((const ALshort*)pData, iDataSize, channels, channelType);
    switch(channelType)
    {
    case 2:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_MONO16"), data, iDataSize * channelType, iFrequency);
    break;
    case 4:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_QUAD16"), data, iDataSize * channelType, iFrequency);
    break;
    case 6:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_51CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    case 7:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_61CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    case 8:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_71CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    }
    delete[] data;
}

instead of
alBufferData(uiBufferID, eBufferFormat, pData, iDataSize, iFrequency);
command.

With this changing I can specify each channel for related buffer's will be played.
I specify each sounds channel value by;
<!-- Channels Enum for 5.1 123456   -->
<!--   1 : Front Left      Speaker  -->
<!--   2 : Front Right     Speaker  -->
<!--   3 : Front Center    Speaker  -->
<!--   4 : Low   Frequency Speaker  -->
<!--   5 : Back  Left      Speaker  -->
<!--   6 : Back  Right     Speaker  -->

In LoadData template function I create the multData sound buffer data in this sequence. I mean for example we have 16 bit sampled 5.1 sound which will be played only front left(this sound's channels:100000) I send the raw pData sound buffer to LoadData function and multiplex this sound data for 6 channel in given sequence order. Create new multData array for 6 channel and start to set this sound array firstly Front Left and Front Right and so on.
So do you think this operation right or now?

With all those changing I want to control channels. Because I have some sounds which only must played on rear left channel and some sounds only front right and etc.
Do you think this approach is suitable?

And another question I want to handle 2.0 speaker like 5.1 and as you can see I use AL_FORMAT_MONO16 for 2 channel. Do you think it's right or not? Should I use AL_FORMAT_STEREO16? Or which enumeration do I need?

If I am so complex, please ask me question to lead you right direction.
Regards.

Ümit Uzun

_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: AL_FORMAT Types and Meanings

by Daniel PEACOCK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message





Hi Ümit,

What is your goal with this algorithm?   Are you trying to extract
particular channels from a wavefile, or are you attempting to mix several
channels into one or more channels (downmixing)?

>> I mean for example we have 16 bit sampled 5.1 sound which will be played
only front left

e..g. Does this mean you want to hear the front-left channel only (and
remove the other 5 channels of data), or do you want to mix all 6 channels
together into a mono file?

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@gmail                                            
             .com>                                                      To
             Sent by:                  OpenAL                              
             openal-bounces@op         <openal@...>    
             ensource.creative                                          cc
             .com                                                          
                                                                   Subject
                                       [Openal] AL_FORMAT Types and        
             10/01/2009 02:17          Meanings                            
             PM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi All,

I have needed to control every channel manually so I have injected
Framework.cpp of OpenAL SDK.
I added

template<typename T> T *LoadData(const T *data, int size, const char
*channels, short channelType)
{    size /= sizeof(T);    T *multData = new T[size * channelType];
for(int i = 0; i < size; i++)    {        for(int k = 0; k < channelType;
k++)        {            multData[i * channelType + k] = channels[k] == '1'
? data[i] : 0;        }    }    return multData;
}

const char *channels; // For example 110010
// Find channelType by counting channels value for example 5.1's
channelType == 6
short channelType;
for(channelType = 0; channels[channelType] != NULL; channelType++);
if(fmt.wBitsPerSample == 16)   // assumes 16-bit short
{    ALshort *data = LoadData((const ALshort*)pData, iDataSize, channels,
channelType);    switch(channelType)    {    case 2:
alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_MONO16"), data,
iDataSize * channelType, iFrequency);    break;    case 4:
alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_QUAD16"), data,
iDataSize * channelType, iFrequency);    break;    case 6:
alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_51CHN16"), data,
iDataSize * channelType, iFrequency);    break;    case 7:
alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_61CHN16"), data,
iDataSize * channelType, iFrequency);    break;    case 8:
alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_71CHN16"), data,
iDataSize * channelType, iFrequency);    break;    }    delete[] data;
}

instead of
alBufferData(uiBufferID, eBufferFormat, pData, iDataSize, iFrequency);
command.

With this changing I can specify each channel for related buffer's will be
played.
I specify each sounds channel value by;
<!-- Channels Enum for 5.1 123456   -->
<!--   1 : Front Left      Speaker  -->
<!--   2 : Front Right     Speaker  -->
<!--   3 : Front Center    Speaker  -->
<!--   4 : Low   Frequency Speaker  -->
<!--   5 : Back  Left      Speaker  -->
<!--   6 : Back  Right     Speaker  -->

In LoadData template function I create the multData sound buffer data in
this sequence. I mean for example we have 16 bit sampled 5.1 sound which
will be played only front left(this sound's channels:100000) I send the raw
pData sound buffer to LoadData function and multiplex this sound data for 6
channel in given sequence order. Create new multData array for 6 channel
and start to set this sound array firstly Front Left and Front Right and so
on.
So do you think this operation right or now?

With all those changing I want to control channels. Because I have some
sounds which only must played on rear left channel and some sounds only
front right and etc.
Do you think this approach is suitable?

And another question I want to handle 2.0 speaker like 5.1 and as you can
see I use AL_FORMAT_MONO16 for 2 channel. Do you think it's right or not?
Should I use AL_FORMAT_STEREO16? Or which enumeration do I need?

If I am so complex, please ask me question to lead you right direction.
Regards.

Ümit Uzun_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT000754CE


_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: AL_FORMAT Types and Meanings

by Ümit Uzun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Danial,

>>What is your goal with this algorithm? Are you trying to extract particular channels from a wavefile, or are you attempting to mix >>several channels into one or more channels (downmixing)?
My all wavefiles are mono channel. What I am trying to do is I want to hear each sound from specified channel. Actually extracting mono sound to particular channel only.

>>Does this mean you want to hear the front-left channel only (and remove the other 5 channels of data),
Yes I want to hear my mono sound only from front-left or assigned channels and the other would be silent on 5.1 6.1 or 7.1 speaker system.

Think that, I have 7.1 speaker system and I have 7+1 room in my home. And every channel located to each room one by one. I mean every room has one channel of speaker system. And My central computer plays 8 music and each music will be played only assigned channel or channels.
How can I do, or Does my algorithm really support this capability?

Thanks and Regards.

Ümit Uzun


2009/10/2 Daniel PEACOCK <dpeacock@...>

Hi Ümit,

What is your goal with this algorithm? Are you trying to extract particular channels from a wavefile, or are you attempting to mix several channels into one or more channels (downmixing)?



>> I mean for example we have 16 bit sampled 5.1 sound which will be played only front left

e..g. Does this mean you want to hear the front-left channel only (and remove the other 5 channels of data), or do you want to mix all 6 channels together into a mono file?

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


Inactive hide details for Ümit Uzun <umituzun84@gmail.com>Ümit Uzun <umituzun84@...>



To

OpenAL <openal@...>

cc


Subject

[Openal] AL_FORMAT Types and Meanings

Hi All,

I have needed to control every channel manually so I have injected Framework.cpp of OpenAL SDK.
I added

template<typename T> T *LoadData(const T *data, int size, const char *channels, short channelType)
{
    size /= sizeof(T);

    T *multData = new T[size * channelType];

    for(int i = 0; i < size; i++)
    {
        for(int k = 0; k < channelType; k++)
        {
            multData[i * channelType + k] = channels[k] == '1' ? data[i] : 0;
        }
    }

    return multData;
}

const char *channels; // For example 110010
// Find channelType by counting channels value for example 5.1's channelType == 6
short channelType;
for(channelType = 0; channels[channelType] != NULL; channelType++);
if(fmt.wBitsPerSample == 16)   // assumes 16-bit short
{
    ALshort *data = LoadData((const ALshort*)pData, iDataSize, channels, channelType);
    switch(channelType)
    {
    case 2:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_MONO16"), data, iDataSize * channelType, iFrequency);
    break;
    case 4:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_QUAD16"), data, iDataSize * channelType, iFrequency);
    break;
    case 6:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_51CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    case 7:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_61CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    case 8:
    alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_71CHN16"), data, iDataSize * channelType, iFrequency);
    break;
    }
    delete[] data;
}

instead of
alBufferData(uiBufferID, eBufferFormat, pData, iDataSize, iFrequency);
command.

With this changing I can specify each channel for related buffer's will be played.
I specify each sounds channel value by;
<!-- Channels Enum for 5.1 123456   -->
<!--   1 : Front Left      Speaker  -->
<!--   2 : Front Right     Speaker  -->
<!--   3 : Front Center    Speaker  -->
<!--   4 : Low   Frequency Speaker  -->
<!--   5 : Back  Left      Speaker  -->
<!--   6 : Back  Right     Speaker  -->

In LoadData template function I create the multData sound buffer data in this sequence. I mean for example we have 16 bit sampled 5.1 sound which will be played only front left(this sound's channels:100000) I send the raw pData sound buffer to LoadData function and multiplex this sound data for 6 channel in given sequence order. Create new multData array for 6 channel and start to set this sound array firstly Front Left and Front Right and so on.
So do you think this operation right or now?

With all those changing I want to control channels. Because I have some sounds which only must played on rear left channel and some sounds only front right and etc.
Do you think this approach is suitable?

And another question I want to handle 2.0 speaker like 5.1 and as you can see I use AL_FORMAT_MONO16 for 2 channel. Do you think it's right or not? Should I use AL_FORMAT_STEREO16? Or which enumeration do I need?

If I am so complex, please ask me question to lead you right direction.
Regards.

Ümit Uzun_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT000754CE




_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Re: AL_FORMAT Types and Meanings

by Daniel PEACOCK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message






>> My all wavefiles are mono channel. What I am trying to do is I want to
hear each sound from specified channel. Actually extracting mono sound to
particular channel only.
OK.

The LoadData function looks like it does the right thing (I didn't test it)
- but you will need to be aware that the channel locations will differ for
each wave format.  e.g.

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

So the index of the Rear Left (RL) speaker is 2 for Quad but 4 for 5.1.
(The channel orders can be found by looking at the WAVEFORMATEXTENSIBLE
structure).   So, you if you wanted audio from the RL, you can convert the
mono audio stream to a 4.0 audio stream with channels="0010", but if you
want to output a 5.1 audio stream you would need to set channels="000010".

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.

I'm not sure what the second section of code is trying to accomplish.

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@gmail                                        
             .com>                                                      To
             Sent by:                  OpenAL                          
             openal-bounces@op         <openal@...>
             ensource.creative                                          cc
             .com                                                      
                                                                   Subject
                                       Re: [Openal] AL_FORMAT Types and
             10/02/2009 01:30          Meanings                        
             PM                                                        
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       




Hi Danial,

>>What is your goal with this algorithm? Are you trying to extract
particular channels from a wavefile, or are you attempting to mix >>several
channels into one or more channels (downmixing)?
My all wavefiles are mono channel. What I am trying to do is I want to hear
each sound from specified channel. Actually extracting mono sound to
particular channel only.

>>Does this mean you want to hear the front-left channel only (and remove
the other 5 channels of data),
Yes I want to hear my mono sound only from front-left or assigned channels
and the other would be silent on 5.1 6.1 or 7.1 speaker system.

Think that, I have 7.1 speaker system and I have 7+1 room in my home. And
every channel located to each room one by one. I mean every room has one
channel of speaker system. And My central computer plays 8 music and each
music will be played only assigned channel or channels.
How can I do, or Does my algorithm really support this capability?

Thanks and Regards.

Ümit Uzun


2009/10/2 Daniel PEACOCK <dpeacock@...>
  Hi Ümit,

  What is your goal with this algorithm? Are you trying to extract
  particular channels from a wavefile, or are you attempting to mix several
  channels into one or more channels (downmixing)?




  >> I mean for example we have 16 bit sampled 5.1 sound which will be
  played only front left

  e..g. Does this mean you want to hear the front-left channel only (and
  remove the other 5 channels of data), or do you want to mix all 6
  channels together into a mono file?

  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

  (Embedded image moved to file: pic18619.gif)Inactive hide details for
  Ümit Uzun <umituzun84@...>Ümit Uzun <umituzun84@...>

                                                                       
                         Ümit Uzun <                                
                         umituzun84@gmai                              
                         l.com>                                        
                         Sent by:        (Embedded image moved to file:
                         openal-bounces@ pic19802.gif)                
                         opensource.crea                                To
                         tive.com                      (Embedded image
                                                       moved to file:  
                                                       pic03897.gif)  
                         10/01/2009                    OpenAL <        
                         02:17 PM                      openal@...
                                                       reative.com>    
                                         (Embedded image moved to file:
                                         pic02329.gif)                
                                                                        cc
                                                       (Embedded image
                                                       moved to file:  
                                                       pic04341.gif)  
                                         (Embedded image moved to file:
                                         pic15646.gif)                
                                                                   Subject
                                                       (Embedded image
                                                       moved to file:  
                                                       pic16600.gif)  
                                                       [Openal] AL_FORMAT
                                                       Types and Meanings
                                                                       
                                                                       
                                         (Embedded image moved to file:
                                         pic25274.gif)                
                                                (Embedded image moved to
                                                file: pic25815.gif)    
                                                                       
                                                                       



  Hi All,

  I have needed to control every channel manually so I have injected
  Framework.cpp of OpenAL SDK.
  I added

  template<typename T> T *LoadData(const T *data, int size, const char
  *channels, short channelType)
  {    size /= sizeof(T);    T *multData = new T[size * channelType];
  for(int i = 0; i < size; i++)    {        for(int k = 0; k < channelType;
  k++)        {            multData[i * channelType + k] = channels[k] ==
  '1' ? data[i] : 0;        }    }    return multData;
  }

  const char *channels; // For example 110010
  // Find channelType by counting channels value for example 5.1's
  channelType == 6
  short channelType;
  for(channelType = 0; channels[channelType] != NULL; channelType++);
  if(fmt.wBitsPerSample == 16)   // assumes 16-bit short
  {    ALshort *data = LoadData((const ALshort*)pData, iDataSize, channels,
  channelType);    switch(channelType)    {    case 2:
  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_MONO16"), data,
  iDataSize * channelType, iFrequency);    break;    case 4:
  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_QUAD16"), data,
  iDataSize * channelType, iFrequency);    break;    case 6:
  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_51CHN16"), data,
  iDataSize * channelType, iFrequency);    break;    case 7:
  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_61CHN16"), data,
  iDataSize * channelType, iFrequency);    break;    case 8:
  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_71CHN16"), data,
  iDataSize * channelType, iFrequency);    break;    }    delete[] data;
  }

  instead of
  alBufferData(uiBufferID, eBufferFormat, pData, iDataSize, iFrequency);
  command.

  With this changing I can specify each channel for related buffer's will
  be played.
  I specify each sounds channel value by;
  <!-- Channels Enum for 5.1 123456   -->
  <!--   1 : Front Left      Speaker  -->
  <!--   2 : Front Right     Speaker  -->
  <!--   3 : Front Center    Speaker  -->
  <!--   4 : Low   Frequency Speaker  -->
  <!--   5 : Back  Left      Speaker  -->
  <!--   6 : Back  Right     Speaker  -->

  In LoadData template function I create the multData sound buffer data in
  this sequence. I mean for example we have 16 bit sampled 5.1 sound which
  will be played only front left(this sound's channels:100000) I send the
  raw pData sound buffer to LoadData function and multiplex this sound data
  for 6 channel in given sequence order. Create new multData array for 6
  channel and start to set this sound array firstly Front Left and Front
  Right and so on.
  So do you think this operation right or now?

  With all those changing I want to control channels. Because I have some
  sounds which only must played on rear left channel and some sounds only
  front right and etc.
  Do you think this approach is suitable?

  And another question I want to handle 2.0 speaker like 5.1 and as you can
  see I use AL_FORMAT_MONO16 for 2 channel. Do you think it's right or not?
  Should I use AL_FORMAT_STEREO16? Or which enumeration do I need?

  If I am so complex, please ask me question to lead you right direction.
  Regards.

  Ümit Uzun_______________________________________________
  Openal mailing list
  Openal@...
  http://opensource.creative.com/mailman/listinfo/openal

  ForwardSourceID:NT000754CE
_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT0007554E









_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

pic18619.gif (144 bytes) Download Attachment
pic19802.gif (62 bytes) Download Attachment
pic03897.gif (62 bytes) Download Attachment
pic02329.gif (62 bytes) Download Attachment
pic04341.gif (62 bytes) Download Attachment
pic15646.gif (62 bytes) Download Attachment
pic16600.gif (62 bytes) Download Attachment
pic25274.gif (62 bytes) Download Attachment
pic25815.gif (62 bytes) Download Attachment

Parent Message unknown Fwd: AL_FORMAT Types and Meanings

by Ümit Uzun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal

Parent Message unknown Re: AL_FORMAT Types and Meanings

by Daniel PEACOCK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message





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@gmail                                            
             .com>                                                      To
                                       Daniel PEACOCK                      
             10/05/2009 12:08          <dpeacock@...>        
             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


_______________________________________________
Openal mailing list
Openal@...
http://opensource.creative.com/mailman/listinfo/openal