ZegoAudioConfig.preset constructor

ZegoAudioConfig.preset(
  1. ZegoAudioConfigPreset preset
)

通过预设枚举值创建音频配置

Implementation

ZegoAudioConfig.preset(ZegoAudioConfigPreset preset)
    : bitrate = 48,
      channel = ZegoAudioChannel.Mono,
      codecID = ZegoAudioCodecID.Default {
  codecID = ZegoAudioCodecID.Default;
  switch (preset) {
    case ZegoAudioConfigPreset.BasicQuality:
      bitrate = 16;
      channel = ZegoAudioChannel.Mono;
      break;
    case ZegoAudioConfigPreset.StandardQuality:
      bitrate = 48;
      channel = ZegoAudioChannel.Mono;
      break;
    case ZegoAudioConfigPreset.StandardQualityStereo:
      bitrate = 56;
      channel = ZegoAudioChannel.Stereo;
      break;
    case ZegoAudioConfigPreset.HighQuality:
      bitrate = 128;
      channel = ZegoAudioChannel.Mono;
      break;
    case ZegoAudioConfigPreset.HighQualityStereo:
      bitrate = 192;
      channel = ZegoAudioChannel.Stereo;
      break;
  }
}