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