Compartir a través de


AudioTrack.SetAuxEffectSendLevel(Single) Method

Definition

Sets the send level of the audio track to the attached auxiliary effect #attachAuxEffect(int).

[Android.Runtime.Register("setAuxEffectSendLevel", "(F)I", "GetSetAuxEffectSendLevel_FHandler")]
public virtual Android.Media.TrackStatus SetAuxEffectSendLevel (float level);
[<Android.Runtime.Register("setAuxEffectSendLevel", "(F)I", "GetSetAuxEffectSendLevel_FHandler")>]
abstract member SetAuxEffectSendLevel : single -> Android.Media.TrackStatus
override this.SetAuxEffectSendLevel : single -> Android.Media.TrackStatus

Parameters

level
Single

linear send level

Returns

error code or success, see #SUCCESS, #ERROR_INVALID_OPERATION, #ERROR

Attributes

Remarks

Sets the send level of the audio track to the attached auxiliary effect #attachAuxEffect(int). Effect levels are clamped to the closed interval [0.0, max] where max is the value of #getMaxVolume. A value of 0.0 results in no effect, and a value of 1.0 is full send.

By default the send level is 0.0f, so even if an effect is attached to the player this method must be called for the effect to be applied.

Note that the passed level value is a linear scalar. UI controls should be scaled logarithmically: the gain applied by audio framework ranges from -72dB to at least 0dB, so an appropriate conversion from linear UI input x to level is: x == 0 -&gt; level = 0 0 &lt; x &lt;= R -&gt; level = 10^(72*(x-R)/20/R)

Java documentation for android.media.AudioTrack.setAuxEffectSendLevel(float).

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