setAudioConfig method

Future<void> setAudioConfig(
  1. ZegoAudioConfig config,
  2. {ZegoPublishChannel? channel}
)

Sets up the audio configurations for the specified publish channel.

Available since: 1.3.4 Description: You can set the combined value of the audio codec, bit rate, and audio channel through this function. If the preset value cannot meet the developer's scenario, the developer can set the parameters according to the business requirements. Default value: The default audio config refers to the default value of ZegoAudioConfig. When to call: After the engine is created createEngine, and before publishing startPublishingStream. Restrictions: None. Related APIs: getAudioConfig.

  • config Audio config.
  • channel Publish stream channel.

Implementation

Future<void> setAudioConfig(ZegoAudioConfig config,
    {ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .setAudioConfig(config, channel: channel);
}