Added in API level 26

Configuration


class Configuration : Parcelable
kotlin.Any
   ↳ android.media.VolumeShaper.Configuration

The VolumeShaper.Configuration class contains curve and duration information. It is constructed by the VolumeShaper.Configuration.Builder.

A VolumeShaper.Configuration is used by VolumeAutomation.createVolumeShaper(Configuration) to create a VolumeShaper and by VolumeShaper.replace(Configuration, Operation, boolean) to replace an existing configuration.

The AudioTrack and MediaPlayer classes implement the VolumeAutomation interface.

Summary

Nested classes

Builder class for a VolumeShaper.Configuration object.

Constants
static Int

Cubic interpolated volume curve.

static Int

Cubic interpolated volume curve that preserves local monotonicity.

static Int

Linear interpolated volume curve.

static Int

Stepwise volume curve.

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

Long

Returns the duration of the volume shape in milliseconds.

Int

Returns the interpolator type.

static Int

Returns the maximum number of curve points allowed for VolumeShaper.

FloatArray!

Returns the times (x) coordinate array of the volume curve points.

FloatArray!

Returns the volumes (y) coordinate array of the volume curve points.

Int

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Properties
static Parcelable.Creator<VolumeShaper.Configuration!>

static VolumeShaper.Configuration!

A one second cubic ramp from silence to full volume.

static VolumeShaper.Configuration!

A one second linear ramp from silence to full volume.

static VolumeShaper.Configuration!

A one second sine-squared s-curve ramp from silence to full volume.

static VolumeShaper.Configuration!

A one second sine curve from silence to full volume for energy preserving cross fades.

Constants

INTERPOLATOR_TYPE_CUBIC

Added in API level 26
static val INTERPOLATOR_TYPE_CUBIC: Int

Cubic interpolated volume curve. This is default if unspecified.

Value: 2

INTERPOLATOR_TYPE_CUBIC_MONOTONIC

Added in API level 26
static val INTERPOLATOR_TYPE_CUBIC_MONOTONIC: Int

Cubic interpolated volume curve that preserves local monotonicity. So long as the control points are locally monotonic, the curve interpolation between those points are monotonic. This is useful for cubic spline interpolated volume ramps and ducks.

Value: 3

INTERPOLATOR_TYPE_LINEAR

Added in API level 26
static val INTERPOLATOR_TYPE_LINEAR: Int

Linear interpolated volume curve.

Value: 1

INTERPOLATOR_TYPE_STEP

Added in API level 26
static val INTERPOLATOR_TYPE_STEP: Int

Stepwise volume curve.

Value: 0

Public methods

describeContents

Added in API level 26
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 26
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getDuration

Added in API level 26
fun getDuration(): Long

Returns the duration of the volume shape in milliseconds.

getMaximumCurvePoints

Added in API level 26
static fun getMaximumCurvePoints(): Int

Returns the maximum number of curve points allowed for VolumeShaper.Builder#setCurve(float[], float[]).

getTimes

Added in API level 26
fun getTimes(): FloatArray!

Returns the times (x) coordinate array of the volume curve points.

getVolumes

Added in API level 26
fun getVolumes(): FloatArray!

Returns the volumes (y) coordinate array of the volume curve points.

hashCode

Added in API level 26
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 26
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 26
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 26
static val CREATOR: Parcelable.Creator<VolumeShaper.Configuration!>

CUBIC_RAMP

Added in API level 26
static val CUBIC_RAMP: VolumeShaper.Configuration!

A one second cubic ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching cubic duck.

LINEAR_RAMP

Added in API level 26
static val LINEAR_RAMP: VolumeShaper.Configuration!

A one second linear ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching linear duck.

SCURVE_RAMP

Added in API level 26
static val SCURVE_RAMP: VolumeShaper.Configuration!

A one second sine-squared s-curve ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching sine-squared s-curve duck.

SINE_RAMP

Added in API level 26
static val SINE_RAMP: VolumeShaper.Configuration!

A one second sine curve from silence to full volume for energy preserving cross fades. Use VolumeShaper.Builder#reflectTimes() to generate the matching cosine duck.