嗨經過長期的研究後,我已經找到了解決辦法
在AUGraphController.mm我更改此代碼
// the render notification is used to keep track of the frame number position in the source audio
static OSStatus renderNotification(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
{
Simple_PlayerAppDelegate *appDel = (Simple_PlayerAppDelegate*)[[UIApplication sharedApplication] delegate];
SourceAudioBufferDataPtr userData = (SourceAudioBufferDataPtr)inRefCon;
//NSLog(@"userdata out is %lu",(userData->frameNum/44100));
appDel.secondsFromLocalSong = (userData->frameNum/44100);
if (*ioActionFlags & kAudioUnitRenderAction_PostRender)
{
//printf("post render notification frameNum %ld inNumberFrames %ld\n", userData->frameNum, inNumberFrames);
if(appDel.skipSecondsFromLocalSong>0)
{
userData->frameNum = (appDel.skipSecondsFromLocalSong*userData->maxNumFrames);
appDel.skipSecondsFromLocalSong = 0;
}
else
userData->frameNum += inNumberFrames;
if (userData->frameNum >= userData->maxNumFrames) {
//userData->frameNum = 0;
SilenceData(ioData);
}
}
return noErr;
}
即使我面對一樣。如果你已經解決了它。你可以請分享你的解決方案 – Anand
嗨,我已經完成了這一點。請在下面找到我的解決方案 – Tendulkar