AUGraph & kAudioUnitSubType_GenericOutput
AUGraph & kAudioUnitSubType_GenericOutput
- Subject: AUGraph & kAudioUnitSubType_GenericOutput
- From: "Justin Drury" <email@hidden>
- Date: Thu, 14 Jul 2005 18:01:30 -0700
I'm trying to do what I think a few of us(judging from the archives) have attempted to do but have
failed all day.
Basically I've created an AUGraph that has a format converter(kAudioUnitSubType_AUConverter)
another format converter(varispeed converter[set to 1.0]) and then an output type
(kAudioUnitSubType_GenericOutput). I've wired them all together, set an input callback
kAudioUnitProperty_SetRenderCallback on the format converter, initialized and started the graph(not
sure if that's necessary or not, done it both ways). (Also set kAudioUnitProperty_StreamFormat on
the input and output scopes of the audio units just so there's no question what I'm giving it.
Asserted every error in the hopes I've made a mistake somewhere.)
I then call AudioUnitRender
(outputAudioUnit,&ioActionFlags,&inTimeStamp,inOutputBusNumber,desiredNumFrames,abl); (The
audio buffer list is setup.) My input callback is called I provide/copy the audio that I want to be
pulled up to output unit, return noErr, and...
Get nothing but silence back in my buffer list after the render(0000 for the framecount). Renderflags
for pre and post the callback are 0.
For kicks I've changed the output unit to kAudioUnitSubType_DefaultOutput and my callback gets
called correctly automatically, and I have audio. So my callback is working correctly. The fact my
callback is firing leads me to think my graph is correct(that and the fact I get audio if I don't use the
GenericOutput unit)
The problem of course is I'd love to use the simplicity of having the AUGraph but not have to be
tied down to real time pulls, and be able to process directly to disk. Much like the missing
DiskWriterAUGraph. (I installed the example off my Panther disks to see if I could gleam anything
from it...looked pretty simple and I didn't!)
I've been kicking this around for about 16 hours now, anyone got any suggestions at all what I can
try?
thanks
Justin
(Just for kicks because the only other thing that's different is with a GenericOutput I need to provide
my own AudioBufferList, I'm copying it here in case I mangled something up)
AudioStreamBasicDescription outputASBD;
outputASBD.mFormatID=kAudioFormatLinearPCM;
outputASBD.mSampleRate=44100;
outputASBD.mFormatFlags=kLinearPCMFormatFlagIsFloat | kLinearPCMFormatFlagIsPacked |
kLinearPCMFormatFlagIsBigEndian | kLinearPCMFormatFlagIsNonInterleaved;
outputASBD.mBytesPerPacket=4;
outputASBD.mFramesPerPacket=1;
outputASBD.mBytesPerFrame=4;
outputASBD.mChannelsPerFrame=2;
outputASBD.mBitsPerChannel=32;
abl = (AudioBufferList*)malloc(offsetof (AudioBufferList, mBuffers[outputASBD.mChannelsPerFrame]));
memset(abl,0x55,offsetof(AudioBufferList, mBuffers[outputASBD.mChannelsPerFrame])); // Just
checking making sure I allocated correctly
abl->mNumberBuffers = outputASBD.mChannelsPerFrame;
for (i=0;i<abl->mNumberBuffers;i++)
{
abl->mBuffers[i].mNumberChannels = 1;
abl->mBuffers[i].mDataByteSize = frameCount * outputASBD.mBytesPerFrame;
ablBuffers[i]=malloc(abl->mBuffers[i].mDataByteSize);
abl->mBuffers[i].mData=ablBuffers[i];
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden