java.lang.Object | |
↳ | android.media.PlaybackParams |
Structure for common playback params.
Used by AudioTrack
getPlaybackParams()
and
setPlaybackParams(PlaybackParams)
to control playback behavior.
audio fallback mode: select out-of-range parameter handling.
AUDIO_FALLBACK_MODE_DEFAULT
:
System will determine best handling. AUDIO_FALLBACK_MODE_MUTE
:
Play silence for params normally out of range.AUDIO_FALLBACK_MODE_FAIL
:
Return IllegalArgumentException
from
AudioTrack.setPlaybackParams(PlaybackParams)
.pitch: increases or decreases the tonal frequency of the audio content. It is expressed as a multiplicative factor, where normal pitch is 1.0f.
speed: increases or decreases the time to play back a set of audio or video frames. It is expressed as a multiplicative factor, where normal speed is 1.0f.
Different combinations of speed and pitch may be used for audio playback; some common ones:
setPlaybackRate(int)
.Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AUDIO_FALLBACK_MODE_DEFAULT | ||||||||||
int | AUDIO_FALLBACK_MODE_FAIL | ||||||||||
int | AUDIO_FALLBACK_MODE_MUTE |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Allows defaults to be returned for properties not set.
| |||||||||||
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Retrieves the audio fallback mode.
| |||||||||||
Retrieves the pitch factor.
| |||||||||||
Retrieves the speed factor.
| |||||||||||
Sets the audio fallback mode.
| |||||||||||
Sets the pitch factor.
| |||||||||||
Sets the speed factor.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Allows defaults to be returned for properties not set.
Otherwise a IllegalArgumentException
exception
is raised when getting those properties
which have defaults but have never been set.
PlaybackParams
instance.
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Retrieves the audio fallback mode.
IllegalStateException | if the audio fallback mode is not set. |
---|
Sets the audio fallback mode.
PlaybackParams
instance.
Sets the pitch factor.
PlaybackParams
instance.if the pitch is negative |
Sets the speed factor.
PlaybackParams
instance.
Flatten this object in to a Parcel.
dest | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|