Udostępnij za pośrednictwem


AudioManager.GetStreamVolumeDb(Stream, Int32, Int32) Method

Definition

Returns the volume in dB (decibel) for the given stream type at the given volume index, on the given type of audio output device.

[Android.Runtime.Register("getStreamVolumeDb", "(III)F", "GetGetStreamVolumeDb_IIIHandler", ApiSince=28)]
public virtual float GetStreamVolumeDb (Android.Media.Stream streamType, int index, int deviceType);
[<Android.Runtime.Register("getStreamVolumeDb", "(III)F", "GetGetStreamVolumeDb_IIIHandler", ApiSince=28)>]
abstract member GetStreamVolumeDb : Android.Media.Stream * int * int -> single
override this.GetStreamVolumeDb : Android.Media.Stream * int * int -> single

Parameters

streamType
Stream

stream type for which the volume is queried.

index
Int32

the volume index for which the volume is queried. The index value must be between the minimum and maximum index values for the given stream type (see #getStreamMinVolume(int) and #getStreamMaxVolume(int)).

deviceType
Int32

the type of audio output device for which volume is queried.

Returns

a volume expressed in dB. A negative value indicates the audio signal is attenuated. A typical maximum value at the maximum volume index is 0 dB (no attenuation nor amplification). Muting is reflected by a value of Float#NEGATIVE_INFINITY.

Attributes

Remarks

Returns the volume in dB (decibel) for the given stream type at the given volume index, on the given type of audio output device.

Java documentation for android.media.AudioManager.getStreamVolumeDb(int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to