Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ memcpy返回EXC\u BAD\u访问_C++_Ios_C_Audio_Core Audio - Fatal编程技术网

C++ memcpy返回EXC\u BAD\u访问

C++ memcpy返回EXC\u BAD\u访问,c++,ios,c,audio,core-audio,C++,Ios,C,Audio,Core Audio,我试图使用TPCircularBufferCopyAudioBufferList将AudioBufferList(显然)复制到TPCircularBuffer中。然而,它却无缘无故地返回了一个EXC_BAD_访问权限。我分配缓冲区 它为由TPCircularBufferPrepareEmptyAudioBufferList创建的AudioBufferList打印出(AudioBuffer)[1]=(mNumberChannels=1,mDataByteSize=8192,mData=void*=

我试图使用
TPCircularBufferCopyAudioBufferList
将AudioBufferList(显然)复制到TPCircularBuffer中。然而,它却无缘无故地返回了一个EXC_BAD_访问权限。我分配缓冲区

它为由TPCircularBufferPrepareEmptyAudioBufferList创建的AudioBufferList打印出
(AudioBuffer)[1]=(mNumberChannels=1,mDataByteSize=8192,mData=void*=0x057ba060)
,其中的AudioBufferList描述为
(AudioBuffers[1])mBuffers={
[0]=(mNumberChannels=2,mDataByteSize=8192,mData=void*=0x057dc000)
}
。bytesToCopy是8192,所以我看不出有什么理由失败

外部代码如下所示:

TPCircularBufferCopyAudioBufferList(_circularBuffer, bufferList, NULL, kTPCircularBufferCopyAll, &_inputASBD);//Uses bufferList from EZAudioFile
我检查了一下,分配了_circularBuffer,ABSD没有任何区别,因为它正在复制所有帧

更新: 我注意到打印mData的日志会返回一个TDLogger实例?但是audioBufferList是从EZAudioFile直接传递过来的

Printing description of inBufferList->mBuffers[0].mData:
<TDLogger: 0x5834000>
打印inBufferList的说明->mBuffers[0]。mData:

可能的重复项:,@dragosht您提到的每个重复项我以前都看过,无法适用于我的情况。我已经检查过缓冲区的大小是否足够大。所有这些都是因为指针太小或无法访问。