Re: AUGraph & kAudioUnitSubType_GenericOutput
Re: AUGraph & kAudioUnitSubType_GenericOutput
- Subject: Re: AUGraph & kAudioUnitSubType_GenericOutput
- From: William Stewart <email@hidden>
- Date: Fri, 15 Jul 2005 12:22:02 -0700
What's your time stamp look like?
It should be:
memset to zero
set sample time is valid flag
then, start incrementing the sample count after each call to AURender
by the numFrames you render for
If you look at the auprocess example in the SDK it shows this (as
well as the correct preparation of the abl for *each* call you make
to AURender)
But, I suspect the time stamp is the problem.
Bill
On 14/07/2005, at 6:01 PM, Justin Drury wrote:
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,desired
NumFrames,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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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