Example usage for Java android.media AudioTrack fields, constructors, methods, implement or subclass
The text is from its open source code.
int | PLAYSTATE_STOPPED indicates AudioTrack state is stopped |
int | PLAYSTATE_PAUSED indicates AudioTrack state is paused |
int | PLAYSTATE_PLAYING indicates AudioTrack state is playing |
int | MODE_STATIC Creation mode where audio data is transferred from Java to the native layer only once before the audio starts playing. |
int | MODE_STREAM Creation mode where audio data is streamed from Java to the native layer as the audio is playing. |
int | STATE_UNINITIALIZED State of an AudioTrack that was not successfully initialized upon creation. |
int | STATE_INITIALIZED State of an AudioTrack that is ready to be used. |
int | getMinBufferSize(int sampleRateInHz, int channelConfig, int audioFormat) Returns the estimated minimum buffer size required for an AudioTrack object to be created in the #MODE_STREAM mode. |
int | getNativeOutputSampleRate(int streamType) Returns the output sample rate in Hz for the specified stream type. |
int | getPlaybackHeadPosition() Returns the playback head position expressed in frames. |
int | getState() Returns the state of the AudioTrack instance. |
void | play() Starts playing an AudioTrack. |
void | release() Releases the native AudioTrack resources. |
void | stop() Stops playing the audio data. |
int | write(@NonNull byte[] audioData, int offsetInBytes, int sizeInBytes) Writes the audio data to the audio sink for playback (streaming mode), or copies audio data for later playback (static buffer mode). |
int | write(@NonNull short[] audioData, int offsetInShorts, int sizeInShorts) Writes the audio data to the audio sink for playback (streaming mode), or copies audio data for later playback (static buffer mode). |
int | write(@NonNull ByteBuffer audioData, int sizeInBytes, @WriteMode int writeMode) Writes the audio data to the audio sink for playback (streaming mode), or copies audio data for later playback (static buffer mode). |