Documentation
ExpressVideoSDK Video Call
Documentation
Demo APP
SDK Center
API Center
FAQ
Code Market
Console
Sign Up
Log In
中文站 English
  • Documentation
  • Video Call
  • Upgrade using advanced features
  • Distincitve features
  • Audio mixing

Audio Mixing

Last updated:2023-08-31 15:50

Introduction

Audio mixing means that the SDK integrates third-party audio data with the audio data collected by the microphone into an audio stream, so as to play sound effects (such as applause, whistle), custom sounds, music files, etc. During a call or live broadcast, and let Other members in the room can also hear the sound.

Prerequisites

Before using audio mixing, please make sure:

  • A project has been created in ZEGOCLOUD Console and applied for a valid AppID and AppSign. For details, please refer to Console - How to view project information .
  • ZEGO Express SDK has been integrated into the project to implement basic real-time audio and video functions. For details, please refer to Integrate the SDK and Implement a basic video call.

Start Mixing

After pushing the stream, call the startMixingAudio method to start mixing, and use the "streamID" and "mediaList" (media tag list: "video" or "audio") to mix the audio into the stream being pushed.

  • Use the "video" or "audio" media tags to control the pause and resume operations of the mixed audio.
  • Starting from Chrome 86, when mixing third-party audio, if the local audio is set to mute, the streaming end will not be able to hear the corresponding sound.
const result = zg.startMixingAudio(publishStreamId, [
    $('#extenerVideo1')[0],
    $('#extenerVideo2')[0],
]);
console.warn('mixed', result);

Stop Mixing

Call the stopMixingAudio method to stop mixing.

zg.stopMixingAudio(publishStreamId);
Page Directory
  • Free trial
  • 提交工单
    咨询集成、功能及报价等问题
    电话咨询
    400 1006 604
    Get Consulting
    Scan Wechat QR code