Skip to main content

Speech / Music Streaming

Since Webcaster version 5.8.0 additional audio preprocessing options are available.
Additionally to configuring bitrates (Features > Quality Settings), it is from now on possible to disable or enable the following filters explicitly:

  • autoGainControl - Attempts to automatically maintain a steady overall volume level.
  • echoCancellation - Attempts to prevent echo effects.
  • noiseSuppression - Automatically filters the audio to remove background noise.

Depending on the use case it can make sense to disable or enable all of those filters at once.
In general there are two different types of audio content:

  • Audio containing speech
  • Audio containing music
recommendation

We recommend setting all of the above filters to true for speech/voice streams and all of them to false for music streaming. On most systems these filters will be on by default.

Speech audio

var videoDeviceConfig = {
device: 0, // use first video device
source: 'camera'
};

// set all filters to 'true' for streaming voice/speech
var audioDeviceConfig = {
device: 0, // use first audio device
echoCancellation: true,
autoGainControl: true,
noiseSuppression: true
};

var videoElement = 'video-local'; // preview stream in <video id="video-local"> tag

var previewConfig = {
videoDeviceConfig: videoDeviceConfig,
audioDeviceConfig: audioDeviceConfig,
elementId: videoElement
};

// Start the preview
rtcuser.startPreview(previewConfig);

Music audio

var videoDeviceConfig = {
device: 0, // use first video device
source: 'camera'
};

// set all filters to 'false' for streaming music
var audioDeviceConfig = {
device: 0, // use first audio device
echoCancellation: false,
autoGainControl: false,
noiseSuppression: false
};

var videoElement = 'video-local'; // preview stream in <video id="video-local"> tag

var previewConfig = {
videoDeviceConfig: videoDeviceConfig,
audioDeviceConfig: audioDeviceConfig,
elementId: videoElement
};

// start the preview
rtcuser.startPreview(previewConfig);