High Fidelity (Hi-Fi) Audio

For scenarios like live music, karaoke, podcasts, or professional streaming, you may want to deliver audio that sounds natural and unprocessed. Our SDK provides APIs that let you tune the audio pipeline for higher fidelity.

HiFi Mode

HiFi mode provides an enhanced audio experience by doing two things under the hood:

  1. Studio quality bitrate – switches to a high-quality bitrate for audio publishing.
  2. Disables audio processing – echo cancellation, noise suppression, and automatic gain control are turned off.

The SDK supports three audio bitrate profiles that can be chosen before joining the call:

  • AUDIO_BITRATE_PROFILE_VOICE_STANDARD_UNSPECIFIED – SDK default profile (used if the app doesn’t choose a profile) for standard voice calls with audio processing enabled
  • AUDIO_BITRATE_PROFILE_VOICE_HIGH_QUALITY – High-quality voice profile with audio processing enabled
  • AUDIO_BITRATE_PROFILE_MUSIC_HIGH_QUALITY – HiFi mode for music and professional audio with audio processing disabled

Allow HiFi audio on the call type

HiFi audio is allowed by default on the livestream call type.

You can enable it on other call types by toggling the Allow HiFi audio setting in the call type settings. This setting is available in the Stream Dashboard, under Video & Audio > Call Types > [call type] > Settings > Allow HiFi audio.

Microphone Hi-Fi mode

To enable HiFi audio for the microphone, set the audio bitrate profile to MUSIC_HIGH_QUALITY before joining the call:

// Enable HiFi audio
val result = call.microphone.setAudioBitrateProfile(
    stream.video.sfu.models.AudioBitrateProfile.AUDIO_BITRATE_PROFILE_MUSIC_HIGH_QUALITY
)

if (result.isFailure) {
    // Handle error - HiFi audio may not be enabled in dashboard settings
    // or the call may already be joined
}

// Join the call after setting the profile
call.join()

Important notes:

  • The audio bitrate profile must be set before joining the call. Once the call is joined, changes to the audio bitrate profile will be ignored.
  • HiFi audio must be enabled in the dashboard settings for the call type. If not enabled, setAudioBitrateProfile will return a failure result.

Stereo Playback

To enable stereo playback, set the audio usage to USAGE_MEDIA. This can be configured both before and after joining the call.

Before joining the call

Configure the audio usage when building the StreamVideoClient using CallServiceConfigRegistry:


val callServiceConfigRegistry = CallServiceConfigRegistry()
callServiceConfigRegistry.register(CallType.Default.name) {
    setAudioUsage(AudioAttributes.USAGE_MEDIA)
}

val streamVideo = StreamVideoBuilder(
    context = context,
    apiKey = apiKey,
    user = user,
    token = token,
    callServiceConfigRegistry = callServiceConfigRegistry,
    // ... other parameters
).build()

After joining the call

You can also change the audio usage dynamically after joining:


// Enable stereo playback
val success = call.speaker.setAudioUsage(AudioAttributes.USAGE_MEDIA)

if (success) {
    // Audio usage updated successfully
} else {
    // Failed to update audio usage
}

Note: The default audio usage is USAGE_VOICE_COMMUNICATION which provides mono playback. Setting it to USAGE_MEDIA enables stereo playback, which is ideal for music and high-quality audio scenarios.

© Getstream.io, Inc. All Rights Reserved.