1## 7.8\. Audio 2 3### 7.8.1\. Microphone 4 5If device implementations include a microphone, they: 6 7* [C-1-1] MUST report the `android.hardware.microphone` feature constant. 8* [C-1-2] MUST meet the audio recording requirements in 9[section 5.4](#5_4_audio_recording). 10* [C-1-3] MUST meet the audio latency requirements in 11[section 5.6](#5_6_audio_latency). 12* [SR] Are STRONGLY RECOMMENDED to support near-ultrasound recording as described 13in [section 7.8.3](#7_8_3_near_ultrasound). 14 15If device implementations omit a microphone, they: 16 17* [C-2-1] MUST NOT report the `android.hardware.microphone` feature constant. 18* [C-2-2] MUST implement the audio recording API at least as no-ops, per 19 [section 7](#7_hardware_compatibility). 20 21 22### 7.8.2\. Audio Output 23 24If device implementations include a speaker or an audio/multimedia output 25port for an audio output peripheral such as a 4 conductor 3.5mm audio jack or 26USB host mode port using [USB audio class]( 27https://source.android.com/devices/audio/usb#audioClass), they: 28 29* [C-1-1] MUST report the `android.hardware.audio.output` feature constant. 30* [C-1-2] MUST meet the audio playback requirements in 31[section 5.5](#5_5_audio_playback). 32* [C-1-3] MUST meet the audio latency requirements in 33[section 5.6](#5_6_audio_latency). 34* [SR] STRONGLY RECOMMENDED to support near-ultrasound playback as described 35in [section 7.8.3](#7_8_3_near_ultrasound). 36 37If device implementations do not include a speaker or audio output port, they: 38 39* [C-2-1] MUST NOT report the `android.hardware.audio.output` feature. 40* [C-2-2] MUST implement the Audio Output related APIs as no-ops at least. 41 42 43For the purposes of this section, an "output port" is a 44[physical interface](https://en.wikipedia.org/wiki/Computer_port_%28hardware%29) 45such as a 3.5mm audio jack, HDMI, or USB host mode port with USB audio class. 46Support for audio output over radio-based protocols such as Bluetooth, 47WiFi, or cellular network does not qualify as including an "output port". 48 49#### 7.8.2.1\. Analog Audio Ports 50 51In order to be compatible with the [headsets and other audio accessories]( 52http://source.android.com/accessories/headset-spec.html) 53using the 3.5mm audio plug across the Android ecosystem, if a device 54implementation includes one or more analog audio ports, at least one of the 55audio port(s) SHOULD be a 4 conductor 3.5mm audio jack. 56 57If device implementations have a 4 conductor 3.5mm audio jack, they: 58 59* [C-1-1] MUST support audio playback to stereo headphones and stereo headsets 60with a microphone. 61* [C-1-2] MUST support TRRS audio plugs with the CTIA pin-out order. 62* [C-1-3] MUST support the detection and mapping to the keycodes for the 63following 3 ranges of equivalent impedance between the microphone and ground 64conductors on the audio plug: 65 * **70 ohm or less**: `KEYCODE_HEADSETHOOK` 66 * **210-290 ohm**: `KEYCODE_VOLUME_UP` 67 * **360-680 ohm**: `KEYCODE_VOLUME_DOWN` 68* [C-1-4] MUST trigger `ACTION_HEADSET_PLUG` upon a plug insert, but 69only after all contacts on plug are touching their relevant segments 70on the jack. 71* [C-1-5] MUST be capable of driving at least 150mV ± 10% of output voltage on 72a 32 ohm speaker impedance. 73* [C-1-6] MUST have a microphone bias voltage between 1.8V ~ 2.9V. 74* [SR] STRONGLY RECOMMENDED to detect and map to the keycode for the following 75range of equivalent impedance between the microphone and ground conductors 76on the audio plug: 77 * **110-180 ohm:** `KEYCODE_VOICE_ASSIST` 78* SHOULD support audio plugs with the OMTP pin-out order. 79* SHOULD support audio recording from stereo headsets with a microphone. 80 81 82If device implementations have a 4 conductor 3.5mm audio jack and support a 83microphone, and broadcast the `android.intent.action.HEADSET_PLUG` with the 84extra value microphone set as 1, they: 85 86* [C-2-1] MUST support the detection of microphone on the plugged in audio 87accessory. 88 89### 7.8.3\. Near-Ultrasound 90 91Near-Ultrasound audio is the 18.5 kHz to 20 kHz band. 92 93Device implementations: 94 95* MUST correctly report the support of 96near-ultrasound audio capability via the [AudioManager.getProperty]( 97http://developer.android.com/reference/android/media/AudioManager.html#getProperty%28java.lang.String%29) 98API as follows: 99 100If [`PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND`]( 101http://developer.android.com/reference/android/media/AudioManager.html#PROPERTY_SUPPORT_MIC_NEAR_ULTRASOUND) 102is "true", the following requirements MUST be met by the 103`VOICE_RECOGNITION` and `UNPROCESSED` audio sources: 104 105* [C-1-1] The microphone's mean power response in the 18.5 kHz to 20 kHz band 106 MUST be no more than 15 dB below the response at 2 kHz. 107* [C-1-2] The microphone's unweighted signal to noise ratio over 18.5 kHz to 20 kHz 108 for a 19 kHz tone at -26 dBFS MUST be no lower than 50 dB. 109 110If [`PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND`]( 111http://developer.android.com/reference/android/media/AudioManager.html#PROPERTY_SUPPORT_SPEAKER_NEAR_ULTRASOUND) 112is "true": 113 114* [C-2-1] The speaker's mean response in 18.5 kHz - 20 kHz MUST be no lower 115than 40 dB below the response at 2 kHz. 116