public final class PlaybackParameters extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static PlaybackParameters |
DEFAULT |
The default playback parameters: real-time playback with no silence skipping.
|
float |
pitch |
The factor by which pitch will be shifted.
|
float |
speed |
The factor by which playback will be sped up.
|
| Constructor | Description |
|---|---|
PlaybackParameters(float speed) |
Creates new playback parameters that set the playback speed.
|
PlaybackParameters(float speed,
float pitch) |
Creates new playback parameters that set the playback speed/pitch.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
equals(Object obj) |
|
long |
getMediaTimeUsForPlayoutTimeMs(long timeMs) |
Returns the media time in microseconds that will elapse in
timeMs milliseconds of
wallclock time. |
int |
hashCode() |
|
String |
toString() |
|
PlaybackParameters |
withSpeed(float speed) |
Returns a copy with the given speed.
|
public static final PlaybackParameters DEFAULT
public final float speed
public final float pitch
public PlaybackParameters(float speed)
speed - The factor by which playback will be sped up. Must be greater than zero.public PlaybackParameters(float speed,
float pitch)
speed - The factor by which playback will be sped up. Must be greater than zero.pitch - 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 long getMediaTimeUsForPlayoutTimeMs(long timeMs)
timeMs milliseconds of
wallclock time.timeMs - The time to scale, in milliseconds.@CheckResult public PlaybackParameters withSpeed(float speed)
speed - The new speed.