## 5.1\. Media Codecs ### 5.1.1\. Audio Encoding See more details in [5.1.3. Audio Codecs Details](#5_1_3_audio_codecs_details). Handheld device implementations MUST support the following audio encoding: * [H-0-1] AMR-NB * [H-0-2] AMR-WB * [H-0-3] MPEG-4 AAC Profile (AAC LC) * [H-0-4] MPEG-4 HE AAC Profile (AAC+) * [H-0-5] AAC ELD (enhanced low delay AAC) Television device implementations MUST support the following audio encoding: * [T-0-1] MPEG-4 AAC Profile (AAC LC) * [T-0-2] MPEG-4 HE AAC Profile (AAC+) * [T-0-3] AAC ELD (enhanced low delay AAC) Automotive device implementations MUST support the following audio encoding: * [A-1-1] MPEG-4 AAC Profile (AAC LC) * [A-1-2] MPEG-4 HE AAC Profile (AAC+) * [A-1-3] AAC ELD (enhanced low delay AAC) If device implementations declare `android.hardware.microphone`, they MUST support the following audio encoding: * [C-1-1] PCM/WAVE ### 5.1.2\. Audio Decoding See more details in [5.1.3. Audio Codecs Details](#5_1_3_audio_codecs_details). Handheld device implementations MUST support the following decoding. * [H-0-1] AMR-NB * [H-0-2] AMR-WB If device implementations declare support for the `android.hardware.audio.output` feature, they: * [C-1-1] MPEG-4 AAC Profile (AAC LC) * [C-1-2] MPEG-4 HE AAC Profile (AAC+) * [C-1-3] MPEG-4 HE AACv2 Profile (enhanced AAC+) * [C-1-4] AAC ELD (enhanced low delay AAC) * [C-1-5] FLAC * [C-1-6] MP3 * [C-1-7] MIDI * [C-1-8] Vorbis * [C-1-9] PCM/WAVE * [C-1-10] Opus If device implementations support the decoding of AAC input buffers of multichannel streams (i.e. more than two channels) to PCM through the default AAC audio decoder in the `android.media.MediaCodec` API, the following MUST be supported: * [C-2-1] Decoding MUST be performed without downmixing (e.g. a 5.0 AAC stream must be decoded to five channels of PCM, a 5.1 AAC stream must be decoded to six channels of PCM). * [C-2-2] Dynamic range metadata MUST be as defined in "Dynamic Range Control (DRC)" in ISO/IEC 14496-3, and the `android.media.MediaFormat` DRC keys to configure the dynamic range-related behaviors of the audio decoder. The AAC DRC keys were introduced in API 21,and are: KEY_AAC_DRC_ATTENUATION_FACTOR, KEY_AAC_DRC_BOOST_FACTOR, KEY_AAC_DRC_HEAVY_COMPRESSION, KEY_AAC_DRC_TARGET_REFERENCE_LEVEL and KEY_AAC_ENCODED_TARGET_LEVEL ### 5.1.3\. Audio Codecs Details
Format/Codec | Details | Supported File Types/Container Formats |
---|---|---|
MPEG-4 AAC Profile (AAC LC) |
Support for mono/stereo/5.0/5.1 content with standard sampling rates from 8 to 48 kHz. |
|
MPEG-4 HE AAC Profile (AAC+) | Support for mono/stereo/5.0/5.1 content with standard sampling rates from 16 to 48 kHz. | |
MPEG-4 HE AACv2 Profile (enhanced AAC+) |
Support for mono/stereo/5.0/5.1 content with standard sampling rates from 16 to 48 kHz. | |
AAC ELD (enhanced low delay AAC) | Support for mono/stereo content with standard sampling rates from 16 to 48 kHz. | |
AMR-NB | 4.75 to 12.2 kbps sampled @ 8 kHz | 3GPP (.3gp) |
AMR-WB | 9 rates from 6.60 kbit/s to 23.85 kbit/s sampled @ 16 kHz | |
FLAC | Mono/Stereo (no multichannel). Sample rates up to 48 kHz (but up to 44.1 kHz is RECOMMENDED on devices with 44.1 kHz output, as the 48 to 44.1 kHz downsampler does not include a low-pass filter). 16-bit RECOMMENDED; no dither applied for 24-bit. | FLAC (.flac) only |
MP3 | Mono/Stereo 8-320Kbps constant (CBR) or variable bitrate (VBR) | MP3 (.mp3) |
MIDI | MIDI Type 0 and 1. DLS Version 1 and 2. XMF and Mobile XMF. Support for ringtone formats RTTTL/RTX, OTA, and iMelody |
|
Vorbis |
|
|
PCM/WAVE | 16-bit linear PCM (rates up to limit of hardware). Devices MUST support sampling rates for raw PCM recording at 8000, 11025, 16000, and 44100 Hz frequencies. | WAVE (.wav) |
Opus | Matroska (.mkv), Ogg(.ogg) |
Format/Codec | Details | Supported File Types/Container Formats |
---|---|---|
JPEG | Base+progressive | JPEG (.jpg) |
GIF | GIF (.gif) | |
PNG | PNG (.png) | |
BMP | BMP (.bmp) | |
WebP | WebP (.webp) | |
Raw | ARW (.arw), CR2 (.cr2), DNG (.dng), NEF (.nef), NRW (.nrw), ORF (.orf), PEF (.pef), RAF (.raf), RW2 (.rw2), SRW (.srw) |
Format/Codec | Details | Supported File Types/ Container Formats |
---|---|---|
H.263 |
|
|
H.264 AVC | See section 5.2 and 5.3 for details |
|
H.265 HEVC | See section 5.3 for details | MPEG-4 (.mp4) |
MPEG-2 | Main Profile | MPEG2-TS |
MPEG-4 SP | 3GPP (.3gp) | |
VP8 | See section 5.2 and 5.3 for details |
|
VP9 | See section 5.3 for details |
|