Skip to main content
Version: 0.1.x

Custom Audio Track - React Native

We have introduced the ability to pass a custom Audio track for the Audio of the participants with different encoder configuration.

Creating a Custom Audio Track

  • You can create a Audio Track using createAudioTrack() method of VideoSDK.
  • This method can be used to create audio track using different encoding parameters.


  • encoderConfig:

    • type: String
    • required: true
    • default: speech_standard
    • Allowed values : speech_low_quality | speech_standard | music_standard | standard_stereo | high_quality | high_quality_stereo
    • It will be the encoder configuration you want to use for Audio Track.
  • context

    • type: Context
    • required: true
    • Pass the Android Context for this parameter.


  • CustomStreamTrack


try {
val audioCustomTrack: CustomStreamTrack = VideoSDK.createAudioTrack("high_quality",this)
} catch (e: JSONException) {

Using Custom Audio Track

Custom Track while initializing the meeting

If you are passing micEnabled: true in the initMeeting of VideoSDK and want to use custom tracks from start of the meeting, you can pass custom track in the initMeeting as shown below.

override fun onCreate(savedInstanceState: Bundle?) {

val customTracks: MutableMap<String, CustomStreamTrack> = HashMap()

val audioCustomTrack: CustomStreamTrack = VideoSDK.createAudioTrack("high_quality", this)
customTracks["mic"] = audioCustomTrack //Key must be "mic"

// create a new meeting instance
val meeting = VideoSDK.initMeeting(
//MicEnabled , If true, it will use the passed custom track to turn mic on
//Pass the custom tracks here

Custom Track with unmuteMic()

In order to switch tracks during the meeting, you have to pass the CustomStreamTrack in the unmuteMic() method of Meeting.

You can also pass custom track in changeMic() method of Meeting.


Make sure to call muteMic() before you create a new track as it may lead to unexpected behavior.

try {
val audioCustomTrack: CustomStreamTrack = VideoSDK.createAudioTrack("high_quality", this)

meeting!!.changeMic(AppRTCAudioManager.AudioDevice.BLUETOOTH, audioCustomTrack)
} catch (e: JSONException) {

Got a Question? Ask us on discord