【WebRTC---源码篇】(二十二)WebRTC的混音处理

音频混音主力

音频混音主体主要通过(重采样) + (混音)为主

音频重采样

内容实现是在webrtc::voe中实现的,下面来对重采样全流程逐一分析 。

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,
                 

猜你喜欢

转载自blog.csdn.net/qq_40179458/article/details/131992754