Skip to content

Audio_Mixer

xingkai509 edited this page Nov 22, 2017 · 3 revisions

混音功能介绍

混音功能,主要是针对主播端插上耳机后,背景音乐等无法通过麦克风返采,进而播放端无法听到的问题。 目前最大支持8路音频的混音,并可以灵活调整各路音频音量。

1. 用法示例

封装为filter的音频输入,依次链接mAudioMixer的SinPin即可实现混音 mAudioResampleFilter.getSrcPin().connect(mAudioMixer.getSinkPin(mIdxAudioMic));

2. 接口

  • 调节输入各路音频音量
/**
 * Set input audio source volume,
 * the source audio data would multiply this value before mix.
 *
 * @param idx SinkPin index
 * @param vol volume in [0.0f-1.0f]
*/
    public void setInputVolume(int idx, float vol) {
        setInputVolume(idx, vol, vol);
    }
  • 获取某路输入音频音量
/**
 * return input audio source left channel volume
 *
 * @param idx SinkPin index
 * @return volume in [0.0f-1.0f], null if idx if out of range
 */
public float getInputVolume(int idx);
  • 设置混音输出音量
/**
 * Set output audio volume for left and right channel, the mixer result would multiply this
 * value.
 * @param leftVol left channel volume
 * @param rightVol right channel volume
 */
public void setOutputVolume(float leftVol, float rightVol);
  • 获取混音输出音量
/**
 * Get output audio volume.
 *
 * @return output volume, default value 1.0f
 */
public float getOutputVolume()
  • 设置混音输出静音
/**
 * Mute mixer output or not
 *
 * @param mute true to mute mixer output, false otherwise
 */
public void setMute(boolean mute);

1. 集成指南

2. 基本功能

2.1 采集

2.2 视频处理

2.3 音频处理

3. 开放接口定义

Clone this wiki locally