PlaybackParams.Builder

Added in 1.0.0
Deprecated in 1.3.0

class PlaybackParams.Builder


The builder class that makes it easy to chain setters to create a PlaybackParams object.

Summary

Public constructors

Default constructor

Builder(playbackParams: PlaybackParams)

Constructs a new PlaybackParams builder using data from playbackParams.

Public functions

PlaybackParams

Takes the values of the Builder object and creates a PlaybackParams object.

PlaybackParams.Builder
setAudioFallbackMode(audioFallbackMode: Int)

Sets the audio fallback mode.

PlaybackParams.Builder
setPitch(
    pitch: @FloatRange(from = 0.0, to = Float.MAX_VALUE, fromInclusive = false) Float
)

Sets the pitch factor.

PlaybackParams.Builder
setSpeed(
    speed: @FloatRange(from = 0.0, to = Float.MAX_VALUE, fromInclusive = false) Float
)

Sets the speed factor.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.3.0
Builder()

Default constructor

Builder

Added in 1.0.0
Deprecated in 1.3.0
Builder(playbackParams: PlaybackParams)

Constructs a new PlaybackParams builder using data from playbackParams.

Parameters
playbackParams: PlaybackParams

the non-null instance to initialize from.

Public functions

build

Added in 1.0.0
Deprecated in 1.3.0
fun build(): PlaybackParams

Takes the values of the Builder object and creates a PlaybackParams object.

Returns
PlaybackParams

PlaybackParams object with values from the Builder.

setAudioFallbackMode

Added in 1.0.0
Deprecated in 1.3.0
fun setAudioFallbackMode(audioFallbackMode: Int): PlaybackParams.Builder

Sets the audio fallback mode.

Returns
PlaybackParams.Builder

this Builder instance.

setPitch

Added in 1.0.0
Deprecated in 1.3.0
fun setPitch(
    pitch: @FloatRange(from = 0.0, to = Float.MAX_VALUE, fromInclusive = false) Float
): PlaybackParams.Builder

Sets the pitch factor.

Returns
PlaybackParams.Builder

this Builder instance.

Throws
java.lang.IllegalArgumentException

if the pitch is negative or zero.

setSpeed

Added in 1.0.0
Deprecated in 1.3.0
fun setSpeed(
    speed: @FloatRange(from = 0.0, to = Float.MAX_VALUE, fromInclusive = false) Float
): PlaybackParams.Builder

Sets the speed factor.

Returns
PlaybackParams.Builder

this Builder instance.

Throws
java.lang.IllegalArgumentException

if the speed is negative or zero.