[WebRTC --- source code articles] (22) WebRTC mixing processing

audio mixing workhorse

The main body of audio mixing is mainly through (resampling) + (remixing) main

audio resampling

The content realization is implemented in webrtc::voe, let's analyze the whole process of resampling one by one.

void RemixAndResample(const AudioFrame& src_frame,//源音频数据帧
                      PushResampler<int16_t>* resampler,//重采样对象
                      AudioFrame* dst_frame) {//重采样后的音频帧
  RemixAndResample(src_frame.data(), src_frame.samples_per_channel_,
                   src_frame.num_channels_, src_frame.sample_rate_hz_,
                   resampler, dst_frame);
  dst_frame->timestamp_ = src_frame.timestamp_;
  dst_frame->elapsed_time_ms_ = src_frame.elapsed_time_ms_;
  dst_frame->ntp_time_ms_ = src_frame.ntp_time_ms_;
  dst_frame->packet_infos_ = src_frame.packet_infos_;
}

void RemixAndResample(const int16_t* src_data,
                      size_t samples_per_channel,
                      size_t num_channels,
                      int sample_rate_hz,
                 

Guess you like

Origin blog.csdn.net/qq_40179458/article/details/131992754