为什么使用 opus_demo 命令会出现一些错误?

Why do I get some errors using opus_demo command?

我的目标是将 opus 文件解码为 pcm file.I 尝试 ffmpeg 示例[ not success.And I learn that libopus also can do it from Internet. So I download the libopus[https://opus-codec.org/release/stable/2019/04/12/libopus-1_3_1.html].After 我从编译 opus_demo.c 得到 opus_demo,我 运行 这个。

./opus_demo  
Usage: ./opus_demo [-e] <application> <sampling rate (Hz)> <channels (1/2)> <bits per second>  [options] <input> <output>
       ./opus_demo -d <sampling rate (Hz)> <channels (1/2)> [options] <input> <output>

application: voip | audio | restricted-lowdelay
options:
-e                   : only runs the encoder (output the bit-stream)
-d                   : only runs the decoder (reads the bit-stream as input)
-cbr                 : enable constant bitrate; default: variable bitrate
-cvbr                : enable constrained variable bitrate; default: unconstrained
-delayed-decision    : use look-ahead for speech/music detection (experts only); default: disabled
-bandwidth <NB|MB|WB|SWB|FB> : audio bandwidth (from narrowband to fullband); default: sampling rate
-framesize <2.5|5|10|20|40|60|80|100|120> : frame size in ms; default: 20 
-max_payload <bytes> : maximum payload size in bytes, default: 1024
-complexity <comp>   : complexity, 0 (lowest) ... 10 (highest); default: 10
-inbandfec           : enable SILK inband FEC
-forcemono           : force mono encoding, even for stereo input
-dtx                 : enable SILK DTX
-loss <perc>         : simulate packet loss, in percent (0-100); default: 0

 ./opus_demo -d 16000 2 ./test.opus ./outfile.pcm
libopus 1.3.1
Decoding with 16000 Hz output (2 channels)
Invalid payload length: 440786851
bitrate statistics are undefined

我的 opus 文件是从 ffmpeg 命令捕获的。

ffmpeg -f avfoundation -i :0 out.opus
ffmpeg -i out.opus -acodec pcm_s16le -f s16le -ac 1 -ar 16000 ./out.pcm
ffplay -ar 16000 -ac 1 -f s16le -i ./out.pcm

我该怎么办?并到达我的 goal.Please 帮助我。

这是 Ogg Opus 文件吗? opus_demo 更像是一个 "tutorial",用于学习使用我记忆中的 libopus C 库进行编程。您可以使用 CLI 工具进行解码:

$ opusdec music.opus music.wav

https://opus-codec.org/release/dev/2018/09/18/opus-tools-0_2.html