mutePublishStreamAudio method
- bool mute,
- {ZegoPublishChannel? channel}
Stops or resumes sending the audio part of a stream for the specified channel.
Available since: 1.1.0
Description: This function can be called when publishing the stream to realize not publishing the audio data stream. The SDK still collects and processes the audio, but send muted audio frame packets to the network.
Use case: Users can call this interface when they do not want to publish any audio data. This interface does not affect onBeforeAudioPrepAudioData
.
When to call: Called after the engine is created createEngine can take effect.
Restrictions: None.
Related callbacks: If you stop sending audio streams, the remote user that play stream of local user publishing stream can receive Mute
status change notification by monitoring onRemoteMicStateUpdate callbacks.
Related APIs: mutePublishStreamVideo.
mute
Whether to stop sending audio streams, true means not to send audio stream, and false means sending audio stream. The default is false.channel
Publish stream channel.
Implementation
Future<void> mutePublishStreamAudio(bool mute,
{ZegoPublishChannel? channel}) async {
return await ZegoExpressImpl.instance
.mutePublishStreamAudio(mute, channel: channel);
}