Error on AUGraphInitialize
Error on AUGraphInitialize
- Subject: Error on AUGraphInitialize
- From: "Todd Stanley" <email@hidden>
- Date: Wed, 13 Aug 2008 12:22:09 -0700
Hello All,
I'm having some difficulty playing some audio files while using the TimePitch format converter. With some files, specifically 16k, 1 channel aac files, I get the error -10868 on the call AUGraphInitialize. When I remove the TimePitch node the audio plays correctly. Can anyone shed some light on why I might be having a problem with the TimePitch converter? When I model this setup in AU Lab everything works okay. Any insights would be appreciated.
Todd
playing file: /Users/toddstan/Library/Livescribe/Library/2594160251165/0x1878f237fa2426fc_0/sessions/PRS-1cc18fee7/audio-0.aac
format: AudioStreamBasicDescription: 1 ch, 16000 Hz, 'aac ' (0x00000000) 0 bits/channel, 0 bytes/packet, 1024 frames/packet, 0 bytes/frame
error -10868: AUGraphInitialize
//------------------------------------------------------------------------------------------------------------------------
void MakeSimpleGraph (AUGraph &theGraph, CAAudioUnit &fileCAAU, CAStreamBasicDescription &fileFormat, AudioFileID audioFile)
{
AUNode outputNode, timePitchNode, fileNode;
AudioUnit outputAU, timePitchAU, fileAU;
CAComponentDescription cd;
printf ("format: "); fileFormat.Print();
XThrowIfError (NewAUGraph (&theGraph), "NewAUGraph");
//--------------OutputNode--------------
cd = CAComponentDescription(kAudioUnitType_Output, kAudioUnitSubType_HALOutput, kAudioUnitManufacturer_Apple);
XThrowIfError (AUGraphAddNode (theGraph, &cd, &outputNode), "AUGraphAddNode");
XThrowIfError(AUGraphNodeInfo(theGraph, outputNode, NULL, &outputAU), "AUGraphNodeInfo");
//--------------TimePitch--------------
cd = CAComponentDescription(kAudioUnitType_FormatConverter, kAudioUnitSubType_TimePitch, kAudioUnitManufacturer_Apple);
XThrowIfError(AUGraphAddNode(theGraph, &cd, &timePitchNode), "AUGraphAddNode");
XThrowIfError(AUGraphNodeInfo(theGraph, timePitchNode, NULL, &timePitchAU), "AUGraphNodeInfo");
//--------------FileNode--------------
cd = CAComponentDescription(kAudioUnitType_Generator, kAudioUnitSubType_AudioFilePlayer, kAudioUnitManufacturer_Apple);
XThrowIfError (AUGraphAddNode (theGraph, &cd, &fileNode), "AUGraphAddNode");
XThrowIfError (AUGraphOpen (theGraph), "AUGraphOpen");
XThrowIfError (AUGraphNodeInfo(theGraph, fileNode, NULL, &fileAU), "AUGraphNodeInfo");
fileCAAU = CAAudioUnit (fileNode, fileAU);
XThrowIfError (fileCAAU.SetNumberChannels (kAudioUnitScope_Output, 0, fileFormat.NumberChannels()), "SetNumberChannels");
XThrowIfError (fileCAAU.SetSampleRate (kAudioUnitScope_Output, 0, fileFormat.mSampleRate), "SetSampleRate");
XThrowIfError (fileCAAU.SetProperty(kAudioUnitProperty_ScheduledFileIDs, kAudioUnitScope_Global, 0, &audioFile, sizeof(audioFile)), "SetScheduleFile");
//--------------Connect the graph--------------
XThrowIfError (AUGraphConnectNodeInput (theGraph,
fileNode, 0,
timePitchNode, 0), "AUGraphConnectNodeInput");
XThrowIfError (AUGraphConnectNodeInput (theGraph,
timePitchNode, 0,
outputNode, 0), "AUGraphConnectNodeInput");
XThrowIfError(AUGraphInitialize(theGraph), "AUGraphInitialize");
}
_______________________________________________
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