Skip to main content

Broadcaster Audio Mixing

Palabra Broadcaster lets listeners hear a bit of the original audio while listening to the translated track. This creates a more natural, comfortable experience.

Audio Mixing Controls​

By default, Broadcaster mixes the original track into every translated track. You can control the original track’s volume and ducking behavior.

When creating or updating a Broadcast Task, you can control three settings:

  • original_base_volume (number, 0..1): Base volume of the original track mixed under the translated track. Examples: 0 = off, 0.5 = 50%, 1 = same as the original.

  • original_ducked_volume (number, 0..1): Volume of the original while the translated voice is speaking (ducked state). When translation is silent, playback uses original_base_volume. Example: 0.2 keeps the original at 20% during translated speech so listeners can hear the translation clearly without interference.

  • fade_factor (number, 0..1): Controls how quickly audio fades between original_base_volume and original_ducked_volume. Lower values produce a smoother/longer fade; 1 makes the change instantaneous.

Note: fade_factor is optional. In most cases, omit it to use the server default. Set it only if you need a custom fade speed.

Code example​

  curl -X POST 'https://api.palabra.ai/broadcasts' \
-H "Authorization: Bearer $PALABRA_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "My Stream",
// ...
"original_base_volume": 1,
"original_ducked_volume": 0.2,
"fade_factor": 0.07,
// ...
}'

WebRTC Output Case​

With WebRTC output, you can receive all translated tracks from the room, plus the original track.

Recommendation: set original_base_volume and original_ducked_volume to 0 to disable backend mixing of the original into the translated tracks — this decreases latency and increases quality. Instead, mix the original locally in your client using the original MediaStream track from the room.

Important: If both original_base_volume and original_ducked_volume are 0, set fade_factor to 1 to avoid unintended crossfade artifacts or background noise.

WebRTC Output code example​

  curl -X POST 'https://api.palabra.ai/broadcasts' \
-H "Authorization: Bearer $PALABRA_API_KEY" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data-raw '{
"title": "My Stream",
// ...
"original_base_volume": 0,
"original_ducked_volume": 0,
"fade_factor": 1
//..
"outputs": [
{
"protocol": "webrtc_push",
"lang_codes": ["original", "fr", "de"]
}
]
}'