PlaybackParameters
class PlaybackParameters
Parameters that apply to playback, including speed setting.
Summary
Constants |
|
|---|---|
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(Creates new playback parameters that set the playback speed/pitch. |
Public functions |
|
|---|---|
Boolean |
|
java-static PlaybackParameters! |
@UnstableApiRestores a |
Long |
Returns the media time in microseconds that will elapse in |
Int |
hashCode() |
Bundle! |
|
String! |
toString() |
PlaybackParameters! |
@UnstableApiReturns a copy with the given pitch. |
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
DEFAULT
const val DEFAULT: PlaybackParameters!
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 |
Public functions
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. |
withPitch
@UnstableApi
fun withPitch(pitch: @FloatRange(from = 0, fromInclusive = false) Float): PlaybackParameters!
Returns a copy with the given pitch.
| Parameters | |
|---|---|
pitch: @FloatRange(from = 0, fromInclusive = false) Float |
The new pitch. Must be greater than zero. |
| Returns | |
|---|---|
PlaybackParameters! |
The copied playback parameters. |
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. |