Android.Media.AudioTrack.SetVolume Method
Sets the specified output gain value on all channels of this track.

Syntax

[Android.Runtime.Register("setVolume", "(F)I", "GetSetVolume_FHandler")]
[return:Android.Runtime.GeneratedEnum]
public virtual TrackStatus SetVolume (float gain)

Parameters

gain
output gain for all channels.

Returns

Documentation for this section has not yet been entered.

Remarks

Sets the specified output gain value on all channels of this track.

Gain values are clamped to the closed interval [0.0, max] where max is the value of AudioTrack.MaxVolume. A value of 0.0 results in zero gain (silence), and a value of 1.0 means unity gain (signal unchanged). The default value is 1.0 meaning unity gain.

This API is preferred over AudioTrack.SetStereoVolume(float, System.Single), as it more gracefully scales down to mono, and up to multi-channel content beyond stereo.

The word "volume" in the API name is historical; this is actually a linear gain.

[Android Documentation]

Requirements

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