Audio Profile Settings

This section introduces how to set audio profiles with the audio/video SDK.

1. Introduction

To obtain desired interactive effects, you can combine APIs for audio parameters, interaction modes, and scenario modes to meet different application scenarios' demands for sound quality, audio channel, and real-time performance.

2. Implementation

Audio Profile Settings

Set audio profiles (including audio parameters, interaction modes, and scenario modes) with setAudioConfig:

Audio Parameters

  • THUNDER_AUDIO_CONFIG_DEFAULT(0): default configuration: 1-communication mode, 2-live streaming mode.
  • THUNDER_AUDIO_CONFIG_SPEECH_STANDARD(1): specifies a 16 kHz sampling rate, audio encoding, single channel, and an encoding bit rate of about 18 kbps
  • THUNDER_AUDIO_CONFIG_MUSIC_STANDARD_STEREO(2): specifies a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 24 kbps. High encoding delay
  • THUNDER_AUDIO_CONFIG_MUSIC_STANDARD(3): specifies a 44.1 kHz sampling rate, music encoding, single channel, and an encoding bit rate of about 40 kbps. Low encoding delay
  • THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO(4): specifies a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 128 kbps
  • THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO_192(5): specifies a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 192 kbps

Interaction Mode

  • THUNDER_COMMUT_MODE_DEFAULT(0): default=1
  • THUNDER_COMMUT_MODE_HIGH(1): strong interaction mode
  • THUNDER_COMMUT_MODE_HIGH(2): weak interaction mode

Scenario Mode

  • THUNDER_SCENARIO_MODE_DEFAULT(0): default=1
  • THUNDER_SCENARIO_MODE_STABLE_FIRST(1): smoothness priority: focus on stability, recommended for education
  • THUNDER_SCENARIO_MODE_QUALITY_FIRST(2): audio quality priority: recommended for shows with few or no co-hosting
//High-quality FM
thunderEngine.setAudioConfig(
    THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO,
    THUNDER_COMMUT_MODE_LOW,
    THUNDER_SCENARIO_MODE_QUALITY_FIRST
);

// Premade scenario
thunderEngine.setAudioConfig(
    THUNDER_AUDIO_CONFIG_SPEECH_STANDARD,
    THUNDER_COMMUT_MODE_HIGH,
    THUNDER_SCENARIO_MODE_STABLE_FIRST
);

// Entertainment scenario
thunderEngine.setAudioConfig(
    THUNDER_AUDIO_CONFIG_MUSIC_STANDARD,
    THUNDER_COMMUT_MODE_HIGH,
    THUNDER_SCENARIO_MODE_STABLE_FIRST
);

// KTV
thunderEngine.setAudioConfig(
    THUNDER_AUDIO_CONFIG_MUSIC_HIGH_QUALITY_STEREO,
    THUNDER_COMMUT_MODE_HIGH,
    THUNDER_SCENARIO_MODE_STABLE_FIRST
);

3. API Reference

4. Notices

  • Call setAudioConfig before joinRoom is called.
  • API return value: return 0 for success and return <0 for failure.

Was this page helpful?

Helpful Not helpful
Submitted! Your feedback would help us improve the website.
Feedback
Top
<