Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.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++ opus_encoder_create()返回空指针_C++_C_Codec - Fatal编程技术网

C++ opus_encoder_create()返回空指针

C++ opus_encoder_create()返回空指针,c++,c,codec,C++,C,Codec,我在opus编解码器方面遇到了一些问题 opus_encoder_create()返回空指针并抛出opus_BAD_ARG错误 OpusEncoder * m_enc; m_enc = opus_encoder_create(44100, 2, OPUS_APPLICATION_VOIP, &this->m_error); 这是我从gdb得到的: Program received signal EXC_BAD_ACCESS, Could not access memory. Re

我在opus编解码器方面遇到了一些问题

opus_encoder_create()返回空指针并抛出opus_BAD_ARG错误

OpusEncoder * m_enc;
m_enc = opus_encoder_create(44100, 2, OPUS_APPLICATION_VOIP, &this->m_error);
这是我从gdb得到的:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000001fa4
opus_encode_float (st=0x0, pcm=0x100717e20, frame_size=8, data=0x100840c00 "", out_data_bytes=4000) at opus_encoder.c:581
581     st->rangeFinal = 0;
(gdb) bt
#0  opus_encode_float (st=0x0, pcm=0x100717e20, frame_size=8, data=0x100840c00 "", out_data_bytes=4000) at opus_encoder.c:581
#1  0x0000000100002b1d in Encoder::Encode (this=0x7fff5fbffa70, audioFrame=0x100717e20, frameSize=8) at Encoder.cpp:39
#2  0x000000010000192c in main () at main.cpp:101
你知道为什么吗?谢谢。

列出了支持的采样频率:

这必须是8000、12000、16000、24000或48000中的一个

请注意,44100不在列表中;这似乎是一个“糟糕的论点”错误的极好原因