【问题标题】:opus_encoder_create() return a null pointeropus_encoder_create() 返回一个空指针
【发布时间】:2012-12-04 11:58:54
【问题描述】:

我在使用 opus-codec 时遇到了一些问题。

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

任何想法为什么?谢谢。

【问题讨论】:

    标签: c++ c codec


    【解决方案1】:

    The documentation 列出了支持的采样频率:

    这必须是 8000、12000、16000、24000 或 48000 之一。

    请注意,44100 不在列表中;这似乎是“错误论据”错误的绝佳原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-02
      • 1970-01-01
      • 1970-01-01
      • 2011-02-11
      • 2012-08-18
      • 1970-01-01
      • 1970-01-01
      • 2011-09-11
      相关资源
      最近更新 更多