Android.Media.AudioManager.SetStreamMute Method
Mute or unmute an audio stream.

Syntax

[Android.Runtime.Register("setStreamMute", "(IZ)V", "GetSetStreamMute_IZHandler")]
public virtual void SetStreamMute ([Android.Runtime.GeneratedEnum] Stream streamType, bool state)

See Also

AudioManager.IsVolumeFixed

Parameters

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

Remarks

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.

This method has no effect if the device implements a fixed volume policy as indicated by AudioManager.IsVolumeFixed.

[Android Documentation]

Requirements

Namespace: Android.Media
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1