Linphone Opus编解码器采样率

问题描述 投票:0回答:1

我想在线性电话中使用Opus编解码器

但是我在使用它时遇到了一些问题。如果有人对操作编解码器知识有所了解,可以帮助我,将不胜感激。如何强制音频采样方案达到8000 Hz?当前,它仅使用48000 Hz。

提前感谢

sip voip linphone opus linphone-sdk
1个回答
1
投票

如果您查看rfc7587 Section 4.1,则可以阅读以下内容:

Opus supports 5 different audio bandwidths, which can be adjusted
during a stream.  The RTP timestamp is incremented with a 48000 Hz
clock rate for all modes of Opus and all sampling rates.  The unit
for the timestamp is samples per single (mono) channel.  The RTP
timestamp corresponds to the sample time of the first encoded sample
in the encoded frame.  For data encoded with sampling rates other
than 48000 Hz, the sampling rate has to be adjusted to 48000 Hz.

阅读rfc7587的更多内容,您会发现,在SDP中,无论实际采样率如何,您始终会看到编解码器正在使用“ OPUS / 48000/2”。

不管实际采样率如何,如上所述,RTP时间戳总是以4​​8000 Hz时钟速率递增。

如果您希望控制编解码器的实际采样率(从而控制带宽),则可以使用以下SDP参数:maxplaybackratemaxaveragebitrate是要使用的参数。

第3.1.1节列出了maxaveragebitrate与采样率之间的关系:

3.1.1.  Recommended Bitrate

   For a frame size of 20 ms, these are the bitrate "sweet spots" for  Opus in various configurations:

   o  8-12 kbit/s for NB speech,
   o  16-20 kbit/s for WB speech,
   o  28-40 kbit/s for FB speech,
   o  48-64 kbit/s for FB mono music, and
   o  64-128 kbit/s for FB stereo music.

结论:要在OPUS中仅使用8000Hz,必须与此类参数协商,其中12kbit / s是NB语音中opus的最大设置:

   m=audio 54312 RTP/AVP 101
   a=rtpmap:101 opus/48000/2
   a=fmtp:101 maxplaybackrate=8000; sprop-maxcapturerate=8000; maxaveragebitrate=12000

我不知道linphone是否遵循所有参数,但这是理论!

© www.soinside.com 2019 - 2024. All rights reserved.