-
安装编译过程中的依赖包
sudo apt-get install git autoconf automake libtool gcc make
-
下载opus官方源码
地址:https://www.opus-codec.org/downloads/ 资源:opus-1.3.1.tar.gz 和 opus-tools-0.2.tar.gz
-
解压文件
tar zxvf opus-1.3.1.tar.gz tar zxvf opus-tools-0.2.tar.gz
-
编译opus
cd opus-1.3.1 ./configure make make install
-
对16k 单声道 pcm文件进行16k opus编码
./opus_demo -e voip 16000 1 16000 ./test.pcm ./b.opus
-
对opus文件进行pcm解码
./opus_demo -d 16000 1 b.opus b.pcm
-
wav转opus(转换后的opus无法播放,不带ogg封装)
./opus_demo -e voip 16000 1 16000 ./你是谁.wav ./test.opus
notes:
opus-1.3.1 编解码不带ogg封装
opus-tools-0.2 带ogg封装
.
.
.
opus-1.3.1/README文件
== Opus audio codec ==
Opus is a codec for interactive speech and audio transmission over the Internet.
Opus can handle a wide range of interactive audio applications, including
Voice over IP, videoconferencing, in-game chat, and even remote live music
performances. It can scale from low bit-rate narrowband speech to very high
quality stereo music.
Opus, when coupled with an appropriate container format, is also suitable
for non-realtime stored-file applications such as music distribution, game
soundtracks, portable music players, jukeboxes, and other applications that
have historically used high latency formats such as MP3, AAC, or Vorbis.
Opus is specified by IETF RFC 6716:
https://tools.ietf.org/html/rfc6716
The Opus format and this implementation of it are subject to the royalty-
free patent and copyright licenses specified in the file COPYING.
This package implements a shared library for encoding and decoding raw Opus
bitstreams. Raw Opus bitstreams should be used over RTP according to
https://tools.ietf.org/html/rfc7587
The package also includes a number of test tools used for testing the
correct operation of the library. The bitstreams read/written by these
tools should not be used for Opus file distribution: They include
additional debugging data a