extracting wav samples from a buffer

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

extracting wav samples from a buffer

by jeffmo77 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm fairly new to OpenAL.  I'm streaming some basic *.wav audio data using 4 buffers at a time of size 1024 each.  I'd like to apply some convolution EQ filtering on the audio, but the code I'm trying to use processes the data on a per audio sample basis.  

Can somebody help me figure out how to sequentially read out each individual sample and process it before stuffing it back into the buffer?  All this should happen just prior to the queue for playback.

should I be using fread()?

Thanks

Re: extracting wav samples from a buffer

by Daniel PEACOCK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message





Hi,

You will need some code to parse a wavefile (i.e read the header to
determine the format of the sample data, and then the location of the
actual samples).   Once you know that information, you can indeed just use
something like fread() to pull in chunks of audio data.

If you have the OpenAL for Windows SDK (
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx )
there is an example project called PlayStream that does everything you need
- except for putting the audio data through the convolution EQ effect -
which you can do just after reading the chunk of audio data from disk, and
before putting it in an OpenAL Buffer.

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.




                                                                           
             jeffmo77                                                      
             <jeffmo77@...                                            
             om>                                                        To
             Sent by:                  openal-devel@...
             openal-devel-boun         m                                  
             ces@...                                          cc
             eative.com                                                    
                                                                   Subject
                                       [Openal-devel] extracting wav      
             11/27/2008 05:24          samples from a buffer              
             PM                                                            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           





I'm fairly new to OpenAL.  I'm streaming some basic *.wav audio data using
4
buffers at a time of size 1024 each.  I'd like to apply some convolution EQ
filtering on the audio, but the code I'm trying to use processes the data
on
a per audio sample basis.

Can somebody help me figure out how to sequentially read out each
individual
sample and process it before stuffing it back into the buffer?  All this
should happen just prior to the queue for playback.

should I be using fread()?

Thanks
--
View this message in context:
http://www.nabble.com/extracting-wav-samples-from-a-buffer-tp20715546p20715546.html

Sent from the OpenAL - Dev mailing list archive at Nabble.com.

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

ForwardSourceID:NT000675FA

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