setStreamMute method

Future setStreamMute(
  1. int streamType,
  2. bool state
)

Mute or unmute an audio stream.

The mute command is protected against client process death: if a process with an active mute request on a stream dies, this stream will be unmuted automatically.

The mute requests for a given stream are cumulative: the AudioManager can receive several mute requests from one or more clients and the stream will be unmuted only when the same number of unmute requests are received.

For a better user experience, applications MUST unmute a muted stream in onPause() and mute is again in onResume() if appropriate.

This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.

@param streamType The stream to be muted/unmuted. @param state The required mute state: true for mute ON, false for mute OFF

Implementation

Future setStreamMute(int streamType, bool state) async {}