[Openal] How can I play mono wav sound in specific channel?

Daniel PEACOCK dpeacock at creativelabs.com
Fri Apr 17 06:48:22 PDT 2009






The "Generic Hardware" and "Generic Software" devices only support 16bit
multi-channel buffers, e.g.

AL_FORMAT_QUAD16
AL_FORMAT_51CHN16
AL_FORMAT_61CHN16
AL_FORMAT_71CHN16

You should really check for a valid enum returned by alGetEnumValue, e.g.

  alBufferData(uiBufferID, alGetEnumValue("AL_FORMAT_
  51CHN8"),                 data, iDataSize*6, iFrequency);

  should be replaced with ...

  ALenum eValue = alGetEnumValue("AL_FORMAT_51CHN8");
  if (eValue)
      alBufferData(uiBufferID, eValue, data, iDataSize*6, iFrequency);

Thanks,

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 Belmont Road, Belmont Place, Maidenhead, Berkshire, SL6 6TB



                                                                           
             Ümit Uzun                                                     
             <umituzun84 at gmail                                             
             .com>                                                      To 
             Sent by:                  OpenAL                              
             openal-bounces at op         <openal at opensource.creative.com>    
             ensource.creative                                          cc 
             .com                                                          
                                                                   Subject 
                                       Re: [Openal] How can I play mono    
             04/17/2009 11:48          wav sound in specific channel?      
             AM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Don;

Sorry for inconvenience about GS. While I have tried, I made a mistake I
think. There only 2 channel stereo sound as you said on GS mode. I am
really minded.

But what do you think about AL_FORMAT_MONO8 and AL_FORMAT_MONO16 changing.
When I use 16 bit sample audio can be heard but in 8 bit sample not by
using Chris load_data function as I have said former mail.

Thanks.

2009/4/17 Daniel PEACOCK <dpeacock at creativelabs.com>
  Hi,




  >> There is a audio which is C:\Program Files\OpenAL 1.1
  SDK\samples-backup2\media\fiveptune.wav in OpenAL samples,
  >> and when I play this sound by using GS it can play each voice from
  each speaker pieces succesfully

  Are you sure you are not using the "Generic Hardware" device? The
  "Generic Software" device will only output stereo.


  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 Belmont Road, Belmont Place, Maidenhead, Berkshire, SL6 6TB

  (Embedded image moved to file: pic19895.gif)Inactive hide details for
  Ümit Uzun <umituzun84 at gmail.com>Ümit Uzun <umituzun84 at gmail.com>

                                                                          
                         Ümit Uzun <                                      
                         umituzun84 at gma                                   
                         il.com>                                          
                         Sent by:        (Embedded image moved to file:   
                         openal-bounces  pic05447.gif)                    
                         @opensource.cr                                To 
                         eative.com                 (Embedded image moved 
                                                    to file:              
                                                    pic21726.gif)         
                         04/17/2009                 OpenAL <              
                         10:21 AM                   openal at opensource.cre 
                                                    ative.com>            
                                         (Embedded image moved to file:   
                                         pic14771.gif)                    
                                                                       cc 
                                                    (Embedded image moved 
                                                    to file:              
                                                    pic11538.gif)         
                                         (Embedded image moved to file:   
                                         pic01869.gif)                    
                                                                  Subject 
                                                    (Embedded image moved 
                                                    to file:              
                                                    pic19912.gif)         
                                                    Re: [Openal] How can  
                                                    I play mono wav sound 
                                                    in specific channel?  
                                                                          
                                                                          
                                         (Embedded image moved to file:   
                                         pic25667.gif)                    
                                                (Embedded image moved to  
                                                file: pic26299.gif)       
                                                                          
                                                                          



  Hi Don,

  >I'm not quite sure what you mean.
  >
  >The "GS" device will only output stereo so there is nothing you can do
  to get it to output 5.1 audio. There >maybe some options in your
  soundcard (which one do you have?) for controlling how stereo audio is
  upmixed >(or not) to 5.1 speakers (e.g Creative have a technology called
  CMSS that does this, and you can control the >settings in the Creative
  Audio Control Panel).

  There is a audio which is C:\Program Files\OpenAL 1.1
  SDK\samples-backup2\media\fiveptune.wav in OpenAL samples, and when I
  play this sound by using GS it can play each voice from each speaker
  pieces succesfully. I mean could we control each channel by using canned
  stereo sound on GS mode?
  And I have an onboard sound card(Realtek HD Audio Output).

  Chris and Don; I know I have asked to much but I have a another question
  with your courtesy :) As you know I have used Chris code which we had
  mention yesterday. By this code I can play AL_FORMAT_MONO16 (Enumaration
  4353) audio successfully but when I try to play AL_FORMAT_MONO8
  (Enumaration 4352) audio, there is no sound unfortunately. Do you think;

  if(fmt.wBitsPerSample == 8) {    ALubyte *data = load_data((const
  ALubyte*)pData, iDataSize);    alBufferData(uiBufferID,
  alGetEnumValue("AL_FORMAT_
  51CHN8"),                 data, iDataSize*6, iFrequency);    delete[] data;
  }

  part is correct for handle AL_FORMAT_MONO8 and play on 5.1 speaker
  system?

  Best Regards.
  Thanks in advance.

  --

  Umit Uzun
  _______________________________________________
  Openal mailing list
  Openal at opensource.creative.com
  http://opensource.creative.com/mailman/listinfo/openal

  ForwardSourceID:NT0006B42E



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

ForwardSourceID:NT0006B462
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic19895.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic19895.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic05447.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic05447.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic21726.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic21726.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic14771.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic14771.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic11538.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic11538.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic01869.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic01869.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic19912.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic19912.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic25667.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic25667.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic26299.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal/attachments/20090417/a83eeed5/pic26299.gif


More information about the Openal mailing list