gpt4 book ai didi

iphone - AudioQueueFreeBuffer 警告

转载 作者:行者123 更新时间:2023-12-03 18:40:03 24 4
gpt4 key购买 nike

我收到 API AudioQueueFreeBuffer 的警告“AudioQueueObject::FreeBuffer: AQBuffer * 0x6273fd0 的入队计数为 1”...如何避免此警告?

我在 AudioQueueFreeBuffer API 中收到此警告

        for (int i = 0; i < kNumberBuffers; ++i) {

if(mAudioInfo.mBuffers[i] != NULL)
{
AudioQueueFreeBuffer(mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);
mAudioInfo.mBuffers[i] = NULL;
}
XThrowIfError(AudioQueueAllocateBuffer(mAudioInfo.mQueue, mBufferByteSize, &mAudioInfo.mBuffers[i]), "AudioQueueAllocateBuffer failed");

AQTestBufferCallback (&mAudioInfo, mAudioInfo.mQueue, mAudioInfo.mBuffers[i]);

if (mAudioInfo.mDone) break;
}

最佳答案

当您尝试对已在正在运行的 AudioQueue 中排队的缓冲区调用 AudioQueueFreeBuffer() 时,会发生这种情况。在尝试释放缓冲区之前,您应该在关联的 AudioQueue 上调用 AudioQueueStop()。

The doc's for AudioQueueFreeBuffer() say:

Call this function only if you want to dispose of a particular buffer while continuing to use an audio queue. You can dispose of a buffer only when the audio queue that owns it is stopped (that is, not processing audio data).

关于iphone - AudioQueueFreeBuffer 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4860988/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com