AudioTrackPerformanceMode Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public enum AudioTrackPerformanceMode
type AudioTrackPerformanceMode =
- Inheritance
-
AudioTrackPerformanceMode
Fields
| Name | Value | Description |
|---|---|---|
| None | 0 | Default performance mode for an AudioTrack. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| LowLatency | 1 | Low latency performance mode for an AudioTrack. If the device supports it, this mode enables a lower latency path through to the audio output sink. Effects may no longer work with such an AudioTrack and the sample rate must match that of the output sink. Applications should be aware that low latency requires careful buffer management, with smaller chunks of audio data written by each write() call. If this flag is used without specifying a bufferSizeInBytes then the AudioTrack 's actual buffer size may be too small. It is recommended that a fairly large buffer should be specified when the AudioTrack is created. Then the actual size can be reduced by calling setBufferSizeInFrames(int). The buffer size can be optimized by lowering it after each write() call until the audio glitches, which is detected by calling getUnderrunCount(). Then the buffer size can be increased until there are no glitches. This tuning step should be done while playing silence. This technique provides a compromise between latency and glitch rate. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| PowerSaving | 2 | Power saving performance mode for an AudioTrack. If the device supports it, this mode will enable a lower power path to the audio output sink. In addition, this lower power path typically will have deeper internal buffers and better underrun resistance, with a tradeoff of higher latency. In this mode, applications should attempt to use a larger buffer size and deliver larger chunks of audio data per write() call. Use getBufferSizeInFrames() to determine the actual buffer size of the AudioTrack as it may have increased to accommodate a deeper buffer. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.