PlaybackParameters


class PlaybackParameters : Bundleable


Parameters that apply to playback, including speed setting.

Summary

Constants

const Bundleable.Creator<PlaybackParameters!>!

This property is deprecated.

Use fromBundle instead.

const PlaybackParameters!

The default playback parameters: real-time playback with no silence skipping.

Public constructors

PlaybackParameters(speed: @FloatRange(from = 0, fromInclusive = false) Float)

Creates new playback parameters that set the playback speed.

PlaybackParameters(
    speed: @FloatRange(from = 0, fromInclusive = false) Float,
    pitch: @FloatRange(from = 0, fromInclusive = false) Float
)

Creates new playback parameters that set the playback speed/pitch.

Public functions

Boolean
equals(obj: Any?)
java-static PlaybackParameters!

Restores a PlaybackParameters from a Bundle.

Long

Returns the media time in microseconds that will elapse in timeMs milliseconds of wallclock time.

Int
Bundle!

Returns a Bundle representing the information stored in this object.

String!
PlaybackParameters!
withSpeed(speed: @FloatRange(from = 0, fromInclusive = false) Float)

Returns a copy with the given speed.

Public properties

Float

The factor by which pitch will be shifted.

Float

The factor by which playback will be sped up.

Constants

CREATOR

@UnstableApi
const val CREATORBundleable.Creator<PlaybackParameters!>!

Object that can restore PlaybackParameters from a Bundle.

DEFAULT

const val DEFAULTPlaybackParameters!

The default playback parameters: real-time playback with no silence skipping.

Public constructors

PlaybackParameters

PlaybackParameters(speed: @FloatRange(from = 0, fromInclusive = false) Float)

Creates new playback parameters that set the playback speed. The pitch of audio will not be adjusted, so the effect is to time-stretch the audio.

Parameters
speed: @FloatRange(from = 0, fromInclusive = false) Float

The factor by which playback will be sped up. Must be greater than zero.

PlaybackParameters

PlaybackParameters(
    speed: @FloatRange(from = 0, fromInclusive = false) Float,
    pitch: @FloatRange(from = 0, fromInclusive = false) Float
)

Creates new playback parameters that set the playback speed/pitch.

Parameters
speed: @FloatRange(from = 0, fromInclusive = false) Float

The factor by which playback will be sped up. Must be greater than zero.

pitch: @FloatRange(from = 0, fromInclusive = false) Float

The factor by which the pitch of audio will be adjusted. Must be greater than zero. Useful values are 1 (to time-stretch audio) and the same value as passed in as the speed (to resample audio, which is useful for slow-motion videos).

Public functions

equals

fun equals(obj: Any?): Boolean

fromBundle

@UnstableApi
java-static fun fromBundle(bundle: Bundle!): PlaybackParameters!

Restores a PlaybackParameters from a Bundle.

getMediaTimeUsForPlayoutTimeMs

@UnstableApi
fun getMediaTimeUsForPlayoutTimeMs(timeMs: Long): Long

Returns the media time in microseconds that will elapse in timeMs milliseconds of wallclock time.

Parameters
timeMs: Long

The time to scale, in milliseconds.

Returns
Long

The scaled time, in microseconds.

hashCode

fun hashCode(): Int

toBundle

@UnstableApi
fun toBundle(): Bundle!

Returns a Bundle representing the information stored in this object.

toString

fun toString(): String!

withSpeed

fun withSpeed(speed: @FloatRange(from = 0, fromInclusive = false) Float): PlaybackParameters!

Returns a copy with the given speed.

Parameters
speed: @FloatRange(from = 0, fromInclusive = false) Float

The new speed. Must be greater than zero.

Returns
PlaybackParameters!

The copied playback parameters.

Public properties

pitch

val pitchFloat

The factor by which pitch will be shifted.

speed

val speedFloat

The factor by which playback will be sped up.