See Also: AudioTrack Members
The AudioTrack class manages and plays a single audio resource for Java applications. It allows streaming of PCM audio buffers to the audio sink for playback. This is achieved by "pushing" the data to the AudioTrack object using one of the AudioTrack.Write(Byte[], System.Int32, System.Int32), AudioTrack.Write(Int16[], System.Int32, System.Int32), and AudioTrack.Write(Single[], System.Int32, System.Int32, System.Int32) methods.
An AudioTrack instance can operate under two modes: static or streaming.
In Streaming mode, the application writes a continuous stream of data to the AudioTrack, using
one of the write() methods. These are blocking and return when the data has been
transferred from the Java layer to the native layer and queued for playback. The streaming
mode is most useful when playing blocks of audio data that for instance are:
Upon creation, an AudioTrack object initializes its associated audio buffer.
The size of this buffer, specified during the construction, determines how long an AudioTrack
can play before running out of data.
For an AudioTrack using the static mode, this size is the maximum size of the sound that can
be played from it.
For the streaming mode, data will be written to the audio sink in chunks of
sizes less than or equal to the total buffer size.
AudioTrack is not final and thus permits subclasses, but such use is not recommended.