AudioFlags Enum

Definition

public enum AudioFlags
type AudioFlags = 
Inheritance
AudioFlags

Fields

Name Value Description
None 0
AudibilityEnforced 1

Flag defining a behavior where the audibility of the sound will be ensured by the system. To ensure sound audibility, the system only uses built-in speakers or wired headphones and specifically excludes wireless audio devices. Note this flag should only be used for sounds subject to regulatory behaviors in some countries/regions, such as for camera shutter sound, and not for routing behaviors.

Android reference for android.media.AudioAttributes.FLAG_AUDIBILITY_ENFORCED.

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.

HwAvSync 16

Flag requesting the use of an output stream supporting hardware A/V synchronization.

Android reference for android.media.AudioAttributes.FLAG_HW_AV_SYNC.

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 256

This constant was deprecated in API level 26. Use AudioTrack.Builder.setPerformanceMode(int) with AudioTrack.PERFORMANCE_MODE_LOW_LATENCY to control performance.

Flag requesting a low latency path when creating an AudioTrack. When using this flag, the sample rate must match the native sample rate of the device. Effects processing is also unavailable. Note that 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 AudioTrack.setBufferSizeInFrames(int). The buffer size can be optimized by lowering it after each write() call until the audio glitches, which is detected by calling AudioTrack.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 android.media.AudioAttributes.FLAG_LOW_LATENCY.

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.

Applies to