I'm looking to get some advice on how to set up a proper IO cycle for Audio Playthrough using functions and structures associated with the HAL, specifically those located in AudioHardware.h. Here is the code I have so far.
{
AudioDeviceAddIOProc(inputDeviceID, inputProcess, myBufferPointer);
AudioDeviceAddIOProc(outputDeviceID, outputProcess, myBufferPointer);
AudioDeviceStart(inputDeviceID, inputProcess);
AudioDeviceStart(outputDeviceID, outputProcess);
}
OSStatus inputProcess(AudioDeviceID inDevice, const AudioTimeStamp* inNow, const AudioBufferList* inInputData,
const AudioTimeStamp* inInputTime, AudioBufferList* outOutputData,
const AudioTimeStamp* inOutputTime, void* inClientData)
{
// Need help here. Should be copying input data from the input device to myBufferPointer.
}
OSStatus outputProcess(AudioDeviceID inDevice, const AudioTimeStamp*
inNow, const AudioBufferList* inInputData,
const AudioTimeStamp* inInputTime, AudioBufferList* outOutputData,
const AudioTimeStamp*
inOutputTime, void* inClientData)
{
// Need help here. Should be copying myBufferPointer to the output device for rendering.
}
</code>
If anyone has any advice on how to set up these functions or what type issues I should be aware of to run this simple playthrough, that would be greatly appreciated.
Thanks,
Brad