# MicrophoneInfo

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/media/MicrophoneInfo#nestedclasses)\|[Constants](https://developer.android.com/reference/android/media/MicrophoneInfo#constants)\|[Fields](https://developer.android.com/reference/android/media/MicrophoneInfo#lfields)\|[Methods](https://developer.android.com/reference/android/media/MicrophoneInfo#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/media/MicrophoneInfo#inhmethods)  

# MicrophoneInfo

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/media/MicrophoneInfo "View this page in Kotlin")\|Java

`
public

final

class
MicrophoneInfo
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.MicrophoneInfo |

<br />

*** ** * ** ***

Class providing information on a microphone. It indicates the location and orientation of the microphone on the device as well as useful information like frequency response and sensitivity. It can be used by applications implementing special pre processing effects like noise suppression of beam forming that need to know about precise microphone characteristics in order to adapt their algorithms.

## Summary

|                                                        ### Nested classes                                                         ||
|----------|-------------------------------------------------------------------------------------------------------------------------|
| ` class` | [MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F) <br /> |

|                                                                                                          ### Constants                                                                                                          ||
|---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int`   | [CHANNEL_MAPPING_DIRECT](https://developer.android.com/reference/android/media/MicrophoneInfo#CHANNEL_MAPPING_DIRECT) The channel contains raw audio from this microphone.                                             |
| `int`   | [CHANNEL_MAPPING_PROCESSED](https://developer.android.com/reference/android/media/MicrophoneInfo#CHANNEL_MAPPING_PROCESSED) The channel contains processed audio from this microphone and possibly another microphone. |
| `int`   | [DIRECTIONALITY_BI_DIRECTIONAL](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_BI_DIRECTIONAL) Microphone directionality type: bi-directional.                                    |
| `int`   | [DIRECTIONALITY_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_CARDIOID) Microphone directionality type: cardioid.                                                      |
| `int`   | [DIRECTIONALITY_HYPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_HYPER_CARDIOID) Microphone directionality type: hyper cardioid.                                    |
| `int`   | [DIRECTIONALITY_OMNI](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_OMNI) Microphone directionality type: omni.                                                                  |
| `int`   | [DIRECTIONALITY_SUPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_SUPER_CARDIOID) Microphone directionality type: super cardioid.                                    |
| `int`   | [DIRECTIONALITY_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_UNKNOWN) Unknown microphone directionality.                                                               |
| `int`   | [GROUP_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#GROUP_UNKNOWN) Value used for when the group of the microphone is unknown.                                                        |
| `int`   | [INDEX_IN_THE_GROUP_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#INDEX_IN_THE_GROUP_UNKNOWN) Value used for when the index in the group of the microphone is unknown.                 |
| `int`   | [LOCATION_MAINBODY](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY) A microphone that locate on main body of the device.                                                       |
| `int`   | [LOCATION_MAINBODY_MOVABLE](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY_MOVABLE) A microphone that locate on a movable main body of the device.                             |
| `int`   | [LOCATION_PERIPHERAL](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_PERIPHERAL) A microphone that locate on a peripheral.                                                              |
| `int`   | [LOCATION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_UNKNOWN) A microphone that the location is unknown.                                                                   |
| `float` | [SENSITIVITY_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#SENSITIVITY_UNKNOWN) Value used for when the sensitivity of the microphone is unknown.                                      |
| `float` | [SPL_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#SPL_UNKNOWN) Value used for when the SPL of the microphone is unknown.                                                              |

|                                                                                                                                                         ### Fields                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F) | [ORIENTATION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#ORIENTATION_UNKNOWN) Value used for when the orientation of the microphone is unknown. |
| ` public static final `[MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F) | [POSITION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#POSITION_UNKNOWN) Value used for when the position of the microphone is unknown.          |

|                                                                                                                                                                                                                                                                                               ### Public methods                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                                                                                                                    | ` `[getAddress](https://developer.android.com/reference/android/media/MicrophoneInfo#getAddress())`() ` Returns The "address" string of the microphone that corresponds to the address returned by[AudioDeviceInfo.getAddress()](https://developer.android.com/reference/android/media/AudioDeviceInfo#getAddress()) |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[Pair](https://developer.android.com/reference/android/util/Pair)`<`[Integer](https://developer.android.com/reference/java/lang/Integer)`, `[Integer](https://developer.android.com/reference/java/lang/Integer)`>>` | ` `[getChannelMapping](https://developer.android.com/reference/android/media/MicrophoneInfo#getChannelMapping())`() ` Returns a[Pair](https://developer.android.com/reference/android/util/Pair)list for channel mapping, which indicating how this microphone is used by each channels or a capture stream.         |
| ` `[String](https://developer.android.com/reference/java/lang/String)                                                                                                                                                                                                                    | ` `[getDescription](https://developer.android.com/reference/android/media/MicrophoneInfo#getDescription())`() ` Returns alphanumeric code that uniquely identifies the device.                                                                                                                                       |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getDirectionality](https://developer.android.com/reference/android/media/MicrophoneInfo#getDirectionality())`() ` Returns the directionality of microphone.                                                                                                                                                      |
| ` `[List](https://developer.android.com/reference/java/util/List)`<`[Pair](https://developer.android.com/reference/android/util/Pair)`<`[Float](https://developer.android.com/reference/java/lang/Float)`, `[Float](https://developer.android.com/reference/java/lang/Float)`>>`         | ` `[getFrequencyResponse](https://developer.android.com/reference/android/media/MicrophoneInfo#getFrequencyResponse())`() ` Returns a[Pair](https://developer.android.com/reference/android/util/Pair)list of frequency responses.                                                                                   |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getGroup](https://developer.android.com/reference/android/media/MicrophoneInfo#getGroup())`() ` Returns A device group id that can be used to group together microphones on the same peripheral, attachments or logical groups.                                                                                  |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getId](https://developer.android.com/reference/android/media/MicrophoneInfo#getId())`() ` Returns The system unique device ID that corresponds to the id returned by[AudioDeviceInfo.getId()](https://developer.android.com/reference/android/media/AudioDeviceInfo#getId()).                                    |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getIndexInTheGroup](https://developer.android.com/reference/android/media/MicrophoneInfo#getIndexInTheGroup())`() ` Returns unique index for device within its group.                                                                                                                                            |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getLocation](https://developer.android.com/reference/android/media/MicrophoneInfo#getLocation())`() ` Returns the location of the microphone.                                                                                                                                                                    |
| ` float`                                                                                                                                                                                                                                                                                 | ` `[getMaxSpl](https://developer.android.com/reference/android/media/MicrophoneInfo#getMaxSpl())`() ` Returns the level in dB of the maximum SPL supported by the device at 1000Hz.                                                                                                                                  |
| ` float`                                                                                                                                                                                                                                                                                 | ` `[getMinSpl](https://developer.android.com/reference/android/media/MicrophoneInfo#getMinSpl())`() ` Returns the level in dB of the minimum SPL that can be registered by the device at 1000Hz.                                                                                                                     |
| ` `[MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)                                                                                                                                                                      | ` `[getOrientation](https://developer.android.com/reference/android/media/MicrophoneInfo#getOrientation())`() ` Returns A[Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)object that represents the orientation of microphone.                                      |
| ` `[MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)                                                                                                                                                                      | ` `[getPosition](https://developer.android.com/reference/android/media/MicrophoneInfo#getPosition())`() ` Returns A[Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)object that represents the geometric location of microphone in meters.                           |
| ` float`                                                                                                                                                                                                                                                                                 | ` `[getSensitivity](https://developer.android.com/reference/android/media/MicrophoneInfo#getSensitivity())`() ` Returns the level in dBFS produced by a 1000Hz tone at 94 dB SPL.                                                                                                                                    |
| ` int`                                                                                                                                                                                                                                                                                   | ` `[getType](https://developer.android.com/reference/android/media/MicrophoneInfo#getType())`() ` Returns the device type identifier of the microphone (e.g AudioDeviceInfo.TYPE_BUILTIN_MIC).                                                                                                                       |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### CHANNEL_MAPPING_DIRECT

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CHANNEL_MAPPING_DIRECT
```

The channel contains raw audio from this microphone.

<br />

Constant Value: 1 (0x00000001)  

### CHANNEL_MAPPING_PROCESSED

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int CHANNEL_MAPPING_PROCESSED
```

The channel contains processed audio from this microphone and possibly another microphone.

<br />

Constant Value: 2 (0x00000002)  

### DIRECTIONALITY_BI_DIRECTIONAL

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_BI_DIRECTIONAL
```

Microphone directionality type: bi-directional.

<br />

Constant Value: 2 (0x00000002)  

### DIRECTIONALITY_CARDIOID

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_CARDIOID
```

Microphone directionality type: cardioid.

<br />

Constant Value: 3 (0x00000003)  

### DIRECTIONALITY_HYPER_CARDIOID

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_HYPER_CARDIOID
```

Microphone directionality type: hyper cardioid.

<br />

Constant Value: 4 (0x00000004)  

### DIRECTIONALITY_OMNI

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_OMNI
```

Microphone directionality type: omni.

<br />

Constant Value: 1 (0x00000001)  

### DIRECTIONALITY_SUPER_CARDIOID

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_SUPER_CARDIOID
```

Microphone directionality type: super cardioid.

<br />

Constant Value: 5 (0x00000005)  

### DIRECTIONALITY_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int DIRECTIONALITY_UNKNOWN
```

Unknown microphone directionality.

<br />

Constant Value: 0 (0x00000000)  

### GROUP_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int GROUP_UNKNOWN
```

Value used for when the group of the microphone is unknown.

<br />

Constant Value: -1 (0xffffffff)  

### INDEX_IN_THE_GROUP_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int INDEX_IN_THE_GROUP_UNKNOWN
```

Value used for when the index in the group of the microphone is unknown.

<br />

Constant Value: -1 (0xffffffff)  

### LOCATION_MAINBODY

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LOCATION_MAINBODY
```

A microphone that locate on main body of the device.

<br />

Constant Value: 1 (0x00000001)  

### LOCATION_MAINBODY_MOVABLE

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LOCATION_MAINBODY_MOVABLE
```

A microphone that locate on a movable main body of the device.

<br />

Constant Value: 2 (0x00000002)  

### LOCATION_PERIPHERAL

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LOCATION_PERIPHERAL
```

A microphone that locate on a peripheral.

<br />

Constant Value: 3 (0x00000003)  

### LOCATION_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LOCATION_UNKNOWN
```

A microphone that the location is unknown.

<br />

Constant Value: 0 (0x00000000)  

### SENSITIVITY_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final float SENSITIVITY_UNKNOWN
```

Value used for when the sensitivity of the microphone is unknown.

<br />

Constant Value: -3.4028235E38  

### SPL_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final float SPL_UNKNOWN
```

Value used for when the SPL of the microphone is unknown. This value could be used when maximum SPL or minimum SPL is unknown.

<br />

Constant Value: -3.4028235E38

## Fields

### ORIENTATION_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final MicrophoneInfo.Coordinate3F ORIENTATION_UNKNOWN
```

Value used for when the orientation of the microphone is unknown.

<br />

### POSITION_UNKNOWN

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final MicrophoneInfo.Coordinate3F POSITION_UNKNOWN
```

Value used for when the position of the microphone is unknown.

<br />

## Public methods

### getAddress

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getAddress ()
```

Returns The "address" string of the microphone that corresponds to the address returned by[AudioDeviceInfo.getAddress()](https://developer.android.com/reference/android/media/AudioDeviceInfo#getAddress())

<br />

|                                                               Returns                                                                ||
|--------------------------------------------------------------------|------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the address of the microphone This value cannot be`null`. <br /> |

### getChannelMapping

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<Pair<Integer, Integer>> getChannelMapping ()
```

Returns a[Pair](https://developer.android.com/reference/android/util/Pair)list for channel mapping, which indicating how this microphone is used by each channels or a capture stream. For each[Pair](https://developer.android.com/reference/android/util/Pair), the first value is channel index, the second value is channel mapping type, which could be either[CHANNEL_MAPPING_DIRECT](https://developer.android.com/reference/android/media/MicrophoneInfo#CHANNEL_MAPPING_DIRECT)or[CHANNEL_MAPPING_PROCESSED](https://developer.android.com/reference/android/media/MicrophoneInfo#CHANNEL_MAPPING_PROCESSED). If a channel has contributions from more than one microphone, it is likely the HAL did some extra processing to combine the sources, but this is to be inferred by the user. Empty list when the MicrophoneInfo is returned by AudioManager.getMicrophones(). At least one entry when the MicrophoneInfo is returned by AudioRecord.getActiveMicrophones().

<br />

|                                                                                                                                                                                         Returns                                                                                                                                                                                          ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[Pair](https://developer.android.com/reference/android/util/Pair)`<`[Integer](https://developer.android.com/reference/java/lang/Integer)`, `[Integer](https://developer.android.com/reference/java/lang/Integer)`>>` | a[Pair](https://developer.android.com/reference/android/util/Pair)list for channel mapping <br /> |

### getDescription

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String getDescription ()
```

Returns alphanumeric code that uniquely identifies the device.

<br />

|                                                   Returns                                                    ||
|--------------------------------------------------------------------|------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the description of the microphone <br /> |

### getDirectionality

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getDirectionality ()
```

Returns the directionality of microphone. The return value is one of[DIRECTIONALITY_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_UNKNOWN),[DIRECTIONALITY_OMNI](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_OMNI),[DIRECTIONALITY_BI_DIRECTIONAL](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_BI_DIRECTIONAL),[DIRECTIONALITY_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_CARDIOID),[DIRECTIONALITY_HYPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_HYPER_CARDIOID), or[DIRECTIONALITY_SUPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_SUPER_CARDIOID).

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                              Returns                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the directionality of microphone Value is either`0`or a combination of[DIRECTIONALITY_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_UNKNOWN),[DIRECTIONALITY_OMNI](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_OMNI),[DIRECTIONALITY_BI_DIRECTIONAL](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_BI_DIRECTIONAL),[DIRECTIONALITY_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_CARDIOID),[DIRECTIONALITY_HYPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_HYPER_CARDIOID), and[DIRECTIONALITY_SUPER_CARDIOID](https://developer.android.com/reference/android/media/MicrophoneInfo#DIRECTIONALITY_SUPER_CARDIOID) <br /> |

### getFrequencyResponse

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public List<Pair<Float, Float>> getFrequencyResponse ()
```

Returns a[Pair](https://developer.android.com/reference/android/util/Pair)list of frequency responses. For every[Pair](https://developer.android.com/reference/android/util/Pair)in the list, the first value represents frequency in Hz, and the second value represents response in dB.

<br />

|                                                                                                                                                            Returns                                                                                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| [List](https://developer.android.com/reference/java/util/List)`<`[Pair](https://developer.android.com/reference/android/util/Pair)`<`[Float](https://developer.android.com/reference/java/lang/Float)`, `[Float](https://developer.android.com/reference/java/lang/Float)`>>` | the frequency response of the microphone <br /> |

### getGroup

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getGroup ()
```

Returns A device group id that can be used to group together microphones on the same peripheral, attachments or logical groups. Main body is usually group 0.

<br />

|                                                                                Returns                                                                                 ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the group of the microphone or[GROUP_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#GROUP_UNKNOWN)if the group is unknown <br /> |

### getId

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getId ()
```

Returns The system unique device ID that corresponds to the id returned by[AudioDeviceInfo.getId()](https://developer.android.com/reference/android/media/AudioDeviceInfo#getId()).

<br />

|              Returns              ||
|-------|----------------------------|
| `int` | the microphone's id <br /> |

### getIndexInTheGroup

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getIndexInTheGroup ()
```

Returns unique index for device within its group.

<br />

|                                                                                                        Returns                                                                                                        ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the microphone's index in its group or[INDEX_IN_THE_GROUP_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#INDEX_IN_THE_GROUP_UNKNOWN)if the index in the group is unknown <br /> |

### getLocation

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getLocation ()
```

Returns the location of the microphone. The return value is one of[LOCATION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_UNKNOWN),[LOCATION_MAINBODY](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY),[LOCATION_MAINBODY_MOVABLE](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY_MOVABLE), or[LOCATION_PERIPHERAL](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_PERIPHERAL).

<br />

|                                                                                                                                                                                                                                                                         Returns                                                                                                                                                                                                                                                                         ||
|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | the location of the microphone Value is either`0`or a combination of[LOCATION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_UNKNOWN),[LOCATION_MAINBODY](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY),[LOCATION_MAINBODY_MOVABLE](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_MAINBODY_MOVABLE), and[LOCATION_PERIPHERAL](https://developer.android.com/reference/android/media/MicrophoneInfo#LOCATION_PERIPHERAL) <br /> |

### getMaxSpl

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getMaxSpl ()
```

Returns the level in dB of the maximum SPL supported by the device at 1000Hz.

<br />

|                                                                              Returns                                                                               ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | the maximum level in dB or[SPL_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#SPL_UNKNOWN)if maximum SPL is unknown <br /> |

### getMinSpl

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getMinSpl ()
```

Returns the level in dB of the minimum SPL that can be registered by the device at 1000Hz.

<br />

|                                                                              Returns                                                                               ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | the minimum level in dB or[SPL_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#SPL_UNKNOWN)if minimum SPL is unknown <br /> |

### getOrientation

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public MicrophoneInfo.Coordinate3F getOrientation ()
```

Returns A[Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)object that represents the orientation of microphone. X-axis, Y-axis and Z-axis show as the x, y, z value. The orientation will be normalized such as sqrt(x\^2 + y\^2 + z\^2) equals 1.

<br />

|                                                                                                                                                Returns                                                                                                                                                ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F) | the orientation of the microphone or[ORIENTATION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#ORIENTATION_UNKNOWN)if orientation is unknown <br /> |

### getPosition

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public MicrophoneInfo.Coordinate3F getPosition ()
```

Returns A[Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F)object that represents the geometric location of microphone in meters. X-axis, Y-axis and Z-axis show as the x, y, z values. For mobile devices, the axes originate from the bottom-left-back corner of the appliance. In devices with[PackageManager.FEATURE_AUTOMOTIVE](https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_AUTOMOTIVE), axes are defined with respect to the vehicle body frame, originating from the center of the vehicle's rear axle.

<br />

|                                                                                                                                                      Returns                                                                                                                                                      ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MicrophoneInfo.Coordinate3F](https://developer.android.com/reference/android/media/MicrophoneInfo.Coordinate3F) | the geometric location of the microphone or[POSITION_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#POSITION_UNKNOWN)if the geometric location is unknown <br /> |

**See also:**

- [auto axes](https://source.android.com/devices/sensors/sensor-types#auto_axes)  

### getSensitivity

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public float getSensitivity ()
```

Returns the level in dBFS produced by a 1000Hz tone at 94 dB SPL.

<br />

|                                                                                             Returns                                                                                              ||
|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `float` | the sensitivity of the microphone or[SENSITIVITY_UNKNOWN](https://developer.android.com/reference/android/media/MicrophoneInfo#SENSITIVITY_UNKNOWN)if the sensitivity is unknown <br /> |

### getType

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getType ()
```

Returns the device type identifier of the microphone (e.g AudioDeviceInfo.TYPE_BUILTIN_MIC).

<br />

|                     Returns                     ||
|-------|------------------------------------------|
| `int` | the device type of the microphone <br /> |