Package: android.hardware.audio@4.0

types

Properties

MacAddress

typedef uint8_t[6] MacAddress

IEEE 802 MAC address.

AudioMicrophoneGroup

typedef int32_t AudioMicrophoneGroup

Identifier to help group related microphones together e.g.microphone arrays should belong to the same group

Result

enum Result: int32_t
Details
Members
OK
NOT_INITIALIZED
INVALID_ARGUMENTS
INVALID_STATE
NOT_SUPPORTED
Methods marked as "Optional method" must return this result value if the operation is not supported by HAL.

AudioDrain

enum AudioDrain: int32_t
Details
Members
ALL
drain() returns when all data has been played.
EARLY_NOTIFY
drain() returns a short time before all data from the current track has been played to give time for gapless track switch.
Annotations
export
name="audio_drain_type_t" , value_prefix="AUDIO_DRAIN_"

MmapBufferFlag

enum MmapBufferFlag: uint32_t
Details
Members
NONE = 0x0
APPLICATION_SHAREABLE = 0x1
If the buffer can be securely shared to untrusted applications through the AAudio exclusive mode.Only set this flag if applications are restricted from accessing the memory surrounding the audio data buffer by a kernel mechanism.See Linux kernel's dma_buf.

MessageQueueFlagBits

enum MessageQueueFlagBits: uint32_t

The message queue flags used to synchronize reads and writes from message queues used by StreamIn and StreamOut.

Details
Members
NOT_EMPTY = 1 << 0
NOT_FULL = 1 << 1

AudioMicrophoneChannelMapping

enum AudioMicrophoneChannelMapping: uint32_t

Enum to identify the type of channel mapping for active microphones.Used channels further identify if the microphone has any significative process(e.g.High Pass Filtering, dynamic compression)Simple processing as constant gain adjustment must be DIRECT.

Details
Members
UNUSED = 0
DIRECT = 1
PROCESSED = 2

AudioMicrophoneLocation

enum AudioMicrophoneLocation: uint32_t

Enum to identify locations of microphones in regards to the body of the android device.

Details
Members
UNKNOWN = 0
MAINBODY = 1
MAINBODY_MOVABLE = 2
PERIPHERAL = 3

AudioMicrophoneDirectionality

enum AudioMicrophoneDirectionality: uint32_t

Enum with standard polar patterns of microphones

Details
Members
UNKNOWN = 0
OMNI = 1
BI_DIRECTIONAL = 2
CARDIOID = 3
HYPER_CARDIOID = 4
SUPER_CARDIOID = 5

TimeSpec

struct TimeSpec {uint64_t tvSec; uint64_t tvNSec}

A substitute for POSIX timespec.

Details
Members
tvSec
tvNSec

ParameterValue

struct ParameterValue {string key; string value}
Details
Members
key
value

DeviceAddress

struct DeviceAddress {AudioDevice device; union Address address; string busAddress; string rSubmixAddress}

Specifies a device in case when several devices of the same type can be connected(e.g.BT A2DP, USB).

Details
Members
device
address
busAddress
rSubmixAddress

MmapBufferInfo

struct MmapBufferInfo {memory sharedMemory; uint32_t bufferSizeFrames; uint32_t burstSizeFrames; bitfield flags}

Mmap buffer descriptor returned by IStream.createMmapBuffer().Used by streams opened in mmap mode.

Details
Members
sharedMemory
Mmap memory buffer
bufferSizeFrames
Total buffer size in frames
burstSizeFrames
Transfer size granularity in frames
flags
Attributes describing the buffer.

MmapPosition

struct MmapPosition {int64_t timeNanoseconds; int32_t positionFrames}

Mmap buffer read/write position returned by IStream.getMmapPosition().Used by streams opened in mmap mode.

Details
Members
timeNanoseconds
positionFrames

PlaybackTrackMetadata

struct PlaybackTrackMetadata {AudioUsage usage; AudioContentType contentType; float gain}

Metadata of a playback track for a StreamOut.

Details
Members
usage
contentType
gain
Positive linear gain applied to the track samples.0 being muted and 1 is no attenuation, 2 means double amplification...Must not be negative.

SourceMetadata

struct SourceMetadata {vec tracks}

Metadatas of the source of a StreamOut.

Details
Members
tracks

RecordTrackMetadata

struct RecordTrackMetadata {AudioSource source; float gain}

Metadata of a record track for a StreamIn.

Details
Members
source
gain
Positive linear gain applied to the track samples.0 being muted and 1 is no attenuation, 2 means double amplification...Must not be negative.

SinkMetadata

struct SinkMetadata {vec tracks}

Metadatas of the source of a StreamIn.

Details
Members
tracks

AudioMicrophoneCoordinate

struct AudioMicrophoneCoordinate {float x; float y; float z}

A 3D point used to represent position or orientation of a microphone.

Position:Coordinates of the microphone's capsule, in meters, from the bottom-left-back corner of the bounding box of android device in natural orientation(PORTRAIT for phones, LANDSCAPE for tablets, tvs, etc). The orientation musth match the reported by the api Display.getRotation().

Orientation:Normalized vector to signal the main orientation of the microphone's capsule.Magnitude = sqrt(x^2 + y^2 + z^2)= 1

Details
Members
x
y
z

AudioFrequencyResponsePoint

struct AudioFrequencyResponsePoint {float frequency; float level}

A(frequency, level)pair.Used to represent frequency response.

Details
Members
frequency
In Hz
level
In dB

MicrophoneInfo

struct MicrophoneInfo {string deviceId; DeviceAddress deviceAddress; vec channelMapping; AudioMicrophoneLocation location; AudioMicrophoneGroup group; uint32_t indexInTheGroup; float sensitivity; float maxSpl; float minSpl; AudioMicrophoneDirectionality directionality; vec frequencyResponse; AudioMicrophoneCoordinate position; AudioMicrophoneCoordinate orientation}

Structure used by the HAL to describe microphone's characteristics Used by StreamIn and Device

Details
Members
deviceId
Unique alphanumeric id for microphone.Guaranteed to be the same even after rebooting.
deviceAddress
Device specific information
channelMapping
Each element of the vector must describe the channel with the same index.
location
Location of the microphone in regard to the body of the device
group
Identifier to help group related microphones together e.g.microphone arrays should belong to the same group
indexInTheGroup
Index of this microphone within the group .(group, index)must be unique within the same device.
sensitivity
Level in dBFS produced by a 1000 Hz tone at 94 dB SPL
maxSpl
Level in dB of the max SPL supported at 1000 Hz
minSpl
Level in dB of the min SPL supported at 1000 Hz
directionality
Standard polar pattern of the microphone
frequencyResponse
Vector with ordered frequency responses(from low to high frequencies)with the frequency response of the microphone.Levels are in dB, relative to level at 1000 Hz
position
Position of the microphone's capsule in meters, from the bottom-left-back corner of the bounding box of device.
orientation
Normalized point to signal the main orientation of the microphone's capsule.sqrt(x^2 + y^2 + z^2)= 1