AUVarispeed strangeness
AUVarispeed strangeness
- Subject: AUVarispeed strangeness
- From: "Kevin Dixon" <email@hidden>
- Date: Tue, 1 Apr 2008 21:52:42 -0400 (EDT)
- Importance: Normal
I'm trying to render a file through an AUVarispeed (its just floating in a
AUGraph, with no connections).
I am using a callback to supply the AU with data, set as so:
AURenderCallbackStruct cb = { SFEngine::AudioSupplyCallback, this };
AudioUnitSetProperty(mVarispeedUnit, kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input, 0, &cb, sizeof(cb));
which returns noErr.
Then, I set the stream description for the input/output as well as the
channel layouts.
I set the parameters for playback rate to "1" and pitch cents to "0", just
to try and pass audio.
I set the kAudioOfflineUnitProperty_InputSize and
kAudioOfflineUnitProperty_OutputSize on the Global scope to the same size
as my kNumFramesPerSlice (512)
I then perform the rendering as such:
UInt32 kNumFramesPerSlice = 512;
//run until the SMPTE file is out of data
while((!inputFileEOFReached) && (processStatus != kSFEngineStatus_Abort)) {
AudioUnitRenderActionFlags actionFlags =
kAudioOfflineUnitRenderAction_Render;
AudioUnitSetProperty(mVarispeedUnit,
kAudioUnitOfflineProperty_StartOffset, kAudioUnitScope_Global, 0,
&(curTime.mSampleTime), sizeof(curTime.mSampleTime));
//TODO: schedule parameters
err = AudioUnitRender(mVarispeedUnit, &actionFlags, &curTime, 0,
kNumFramesPerSlice, theAudioData);
if((actionFlags == kAudioOfflineUnitRenderAction_Render |
kAudioOfflineUnitRenderAction_Complete) &&
(theAudioData->mBuffers[0].mDataByteSize != 0)) {
ExtAudioFileWrite(outputFile, theAudioData->mBuffers[0].mDataByteSize /
sizeof(Float32), theAudioData);
}
curTime.mSampleTime += kNumFramesPerSlice;
}
the Varispeed reports Render | Complete, but the mDataByteSize is always
something in the neighborhood of 4294965248, which I find hard to believe,
given a 512 input size.
Apparently I've neglected to set some property or something correctly.
This same style of Render loop has worked fine for me with other
AudioUnits before.
Any suggestions would be appreciated! Thanks,
-Kevin
_______________________________________________
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