Message: 6
Date: Wed, 6 Dec 2006 23:50:10 +0530
Subject: playing audio from buffer
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi
I am a newbie to COreAudio trying to port some code from Windows
,which plays audio from buffer using winmm ,to Mac .
I could only find one sample code named as "PlayAudioFileLite" to
playback an audio file using the Default Output Audio Unit. But my aim
is to play audio from a buffer. I fill that input buffer in each
interval of time and also set the buffer length for each call back
reference . However all I am getting are some breaks and noise. Since
I could not find any API's or sample code which shows how to play
from the buffer , the approach I am taking is to:
a) My chain consists of 2 components - Default Output component and
converter .
b) Open the output device component and use that to set the properties
of the converter component
c) The Render Procedure callback is where I have put the code to
provide the data from the input buffer to the converter.
Is this approach correct or is there any reference on how to read and
play from a buffer ? Thanks in advance for the help.
You can check out /Developer/Examples/SimpleSDK/DefaultOutputUnit for how to latch into the Render callback.