getTrackSetting static method

HMSTrackSetting getTrackSetting({
  1. required bool isAudioMixerDisabled,
  2. required bool joinWithMutedVideo,
  3. required bool joinWithMutedAudio,
  4. required bool isSoftwareDecoderDisabled,
  5. required bool isNoiseCancellationEnabled,
  6. required bool isAutomaticGainControlEnabled,
  7. required bool isNoiseSuppressionEnabled,
  8. HMSAudioMode? audioMode,
})

Implementation

static HMSTrackSetting getTrackSetting({
  required bool isAudioMixerDisabled,
  required bool joinWithMutedVideo,
  required bool joinWithMutedAudio,
  required bool isSoftwareDecoderDisabled,
  required bool isNoiseCancellationEnabled,
  required bool isAutomaticGainControlEnabled,
  required bool isNoiseSuppressionEnabled,
  HMSAudioMode? audioMode,
}) {
  return HMSTrackSetting(
      audioTrackSetting: HMSAudioTrackSetting(

          ///If audio mixer is disabled we set the audio source as null
          ///Note that this is only required for iOS
          audioSource: isAudioMixerDisabled
              ? null
              : HMSAudioMixerSource(node: [
                  HMSAudioFilePlayerNode("audioFilePlayerNode"),
                  HMSMicNode(),
                  HMSScreenBroadcastAudioReceiverNode(),
                ]),
          trackInitialState: joinWithMutedAudio
              ? HMSTrackInitState.MUTED
              : HMSTrackInitState.UNMUTED,
          audioMode: audioMode,
          enableNoiseCancellation: isNoiseCancellationEnabled,
          enableAutomaticGainControl: isAutomaticGainControlEnabled,
          enableNoiseSupression: isNoiseSuppressionEnabled),
      videoTrackSetting: HMSVideoTrackSetting(
          trackInitialState: joinWithMutedVideo
              ? HMSTrackInitState.MUTED
              : HMSTrackInitState.UNMUTED,
          forceSoftwareDecoder: isSoftwareDecoderDisabled,
          isVirtualBackgroundEnabled:
              AppDebugConfig.isVirtualBackgroundEnabled));
}