Audio glitches during playback thru Remote IO unit (iPhone)
Audio glitches during playback thru Remote IO unit (iPhone)
- Subject: Audio glitches during playback thru Remote IO unit (iPhone)
- From: "Zhiye (Sterling) Li" <email@hidden>
- Date: Wed, 12 Aug 2009 00:42:24 -0500
Hello,
Hope somebody can help me figure this out.
In my iPhone application, I am using the Remote IO unit to do the recording and playback. The recording has no problem at all, but when playing back an audio file, the audio clicks once every a few minutes, sometimes even more frequently.
Here's my playback callback funtion:
static OSStatus PlaybackCallback(
void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData)
{ AppDelegate *THIS = (AppDelegate *)inRefCon;
if (!THIS.auOutputFlag) {
// fill the buffer with zeros.
memset(ioData->mBuffers[0].mData,0,ioData->mBuffers[0].mDataByteSize);
return noErr;
}
// Read data from file
ExtAudioFileRead (THIS.audiofile,&inNumberFrames,ioData);
return noErr;
}
Since it doesn't glitch at the same place every time, it means the recording is fine. I have tried the double-buffering method, but it didn't make it any better and the audio still clicks. Changing the buffer size also didn't solve the problem. The most frustrating thing is that all the Remote IO sample code I have found do not playback audio from a file... this has driven me crazy... Has anyone ever used remote io to playback an audio file? Anyone had the same or similar problem before? Hope somebody can help me out. Thank you in advance!
Zhiye
_______________________________________________
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