PlaybackParams.Builder

Added in 1.0.0
Deprecated in 1.3.0

public final class PlaybackParams.Builder


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

Summary

Public constructors

Default constructor

Builder(@NonNull PlaybackParams playbackParams)

Constructs a new PlaybackParams builder using data from playbackParams.

Public methods

@NonNull PlaybackParams

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

@NonNull PlaybackParams.Builder
setAudioFallbackMode(int audioFallbackMode)

Sets the audio fallback mode.

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

Sets the pitch factor.

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

Sets the speed factor.

Public constructors

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder()

Default constructor

Builder

Added in 1.0.0
Deprecated in 1.3.0
public Builder(@NonNull PlaybackParams playbackParams)

Constructs a new PlaybackParams builder using data from playbackParams.

Parameters
@NonNull PlaybackParams playbackParams

the non-null instance to initialize from.

Public methods

build

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull PlaybackParams build()

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

Returns
@NonNull PlaybackParams

PlaybackParams object with values from the Builder.

setAudioFallbackMode

Added in 1.0.0
Deprecated in 1.3.0
public @NonNull PlaybackParams.Builder setAudioFallbackMode(int audioFallbackMode)

Sets the audio fallback mode.

Returns
@NonNull PlaybackParams.Builder

this Builder instance.

setPitch

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

Sets the pitch factor.

Returns
@NonNull 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
public @NonNull PlaybackParams.Builder setSpeed(
    @FloatRange(from = 0.0, to = Float.MAX_VALUE, fromInclusive = false) float speed
)

Sets the speed factor.

Returns
@NonNull PlaybackParams.Builder

this Builder instance.

Throws
java.lang.IllegalArgumentException

if the speed is negative or zero.