我有一个基于音频单元的Objective-C音频应用程序,我的问题是当我播放声音然后停止它然后播放另一个声音我听到第一个声音的最后一个缓冲区。我想我应该释放ioData或其他东西,但我的所有尝试都失败了。
static OSStatus playbackCallback(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData)
{
RemoteIOPlayer *remoteIOplayer = (__bridge RemoteIOPlayer *)inRefCon;
for (int i = 0 ; i < ioData->mNumberBuffers; i++)
{
AudioBuffer buffer = ioData->mBuffers[i];
UInt32 *frameBuffer = buffer.mData;
for (int j = 0; j < inNumberFrames; j++)
{
frameBuffer[j]= [[remoteIOplayer inMemoryAudioFile] getNextPacket:inBusNumber];
}
}
return noErr;
}
请帮助:)谢谢。
答案 0 :(得分:0)
好吧它只是关于augraph的本地化并在用户停止后再次初始化