WebRTC混音器模块

The WebRTC Audio Mixer Module

WebRTC混音器模块

The WebRTC audio mixer module is responsible for mixing multiple incoming audio streams (sources) into a single audio stream (mix). It works with 10 ms frames, it supports sample rates up to 48 kHz and up to 8 audio channels. The API is defined in api/audio/audio_mixer.h and it includes the definition of AudioMixer::Source, which describes an incoming audio stream, and the definition of AudioMixer, which operates on a collection of AudioMixer::Source objects to produce a mix.

​WebRTC音频混合器模块负责将多个传入音频流(源)混合为单个音频流(混音)。它适用于10ms帧,支持高达48kHz的采样率和高达8个音频通道。API是在API/audio/audio_mixer.h中定义的,包括AudioMixer::Source的定义,描述了传入的音频流,以及AudioMixer::Source的定义,后者对AudioMiixer::Source对象的集合进行操作以生成混音。

AudioMixer::Source

A source has different characteristic (e.g., sample rate, number of channels, muted state) and it is identified by an SSRC[^1]. AudioMixer::Source::GetAudioFrameWithInfo() is used to retrieve the next 10 ms chunk of audio to be mixed.

​源具有不同的特性(例如,采样率、通道数、静音状态),并且由SSRC[^1]标识。AudioMixer::source::GetAudioFrameWithInfo()用于检索下一个10毫秒的待混合音频块。

[^1]: A synchronization source (SSRC) is the source of a stream of RTP packets, identified by a 32-bit numeric SSRC identifier carried in the RTP header so as not to be dependent upon the network address (see RFC 3550).

​[^1]:同步源(SSRC)是RTP数据包流的源,由RTP标头中携带的32位数字SSRC标识符标识,以便不依赖于网络地址(请参阅RFC 3550)。

AudioMixer

The interface allows to add and remove sources and the AudioMixer::Mix() method allows to generates a mix with the desired number of channels.

​该接口允许添加和删除源,AudioMixer::Mix()方法允许生成具有所通道数的混音。

WebRTC implementation

WebRTC实现

The interface is implemented in different parts of WebRTC:

该接口在WebRTC的不同部分实现:

AudioMixer is thread-safe. The output sample rate of the generated mix is automatically assigned depending on the sample rate of the sources; whereas the number of output channels is defined by the caller^2. Samples from the non-muted sources are summed up and then a limiter is used to apply soft-clipping when needed.

AudioMixer是线程安全的。生成的混音输出采样率是根据源的采样率自动分配的;而输出通道的数量由调用者^2定义。将来自非静音源的样本相加,然后在需要时使用限制器来应用软剪裁。

is used to mix channels in the non-trivial cases - i.e., if the number of channels for a source or the mix is greater than 3.

用于在非常规的情况下混合通道,即,如果源或混合的通道数量大于3。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值