Open In App

How to Add High Definition Audio to Apps in Android 13?

Last Updated : 07 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

You may have come across developing apps where you need support for High Resolution, High Definition audio to capture and process audio, this may be for a better user experience, or for creating better user experiences. In this article, we will look at how to add the support, and also how Android 13 has benefitted us by introducing some really good, HD codecs, but first, we will look at what enhancements has Android 13 bought us.

Enhancements in Android 13

  1. The effects of Downmix and Virtualizer have been adjusted to float. MediaPlayer allows updated accuracy.
  2. Multichannel: Eight channels of multichannel support for the default Android playback effects are tested.
  3. Due to issues with limiting client instances of AudioTrack for apps in Android 8.x, the number of concurrent client output tracks rises from 14 to 40.
  4. For additional concurrent high-resolution audio tracks, the maximum client/server memory grows from 4 MB to 32 MB (depending on total device memory). 
  5. To avoid resource conflicts between programs and the System UI, the total number of mixed tracks is increased from 32 to 256.
  6. Updated extractors and codecs for WAV and FLAC now support float (24+ bits of lossless precision). 
    1. High-frequency: 192 kHz support has been added to the WAV, FLAC, and extractor codecs. 
    2. The standard frequencies of 192 kHz support the effects that come with Android by default are evaluated. 
    3. Standard frequencies 88.2 kHz, 96 kHz, 176.4 kHz, and 192 kHz are allowed.
  7. Timing: The audio framework contains timing information at several points.

High-Quality Outputs in Android 13

We will now have a look at how audio is enhanced when we update the SDK of our app to the latest serve of Google, as according to the latest release developers should have a few points to ponder before they release the app to the public.

Under frameworks/av/media/libeffects is a reference implementation for output effects.

Developers should carry out the following for the Android 10 release when adding their own unique output effects:

To support the multichannel float format, update the output effects:

  1. Support for output channel numbers between 2 and 8 (for future compatibility consider counts from 1–30).
  2. Auxiliary effects still have a single input channel (mono).
  3. Support for Int16 processing is no longer necessary.
  4. Support matching input and output channel count when using insert effects. 
  5. If you have to maintain legacy vendor output effects but are unable to update them, check the legacy code as follows:
    1. Effect CMD SET CONFIG must reject unsupported settings for legacy output (insert) effects.
    2. Verify that int16 is the format.
    3. Verify the stereos of the input and output channel masks.
  6. Depending on whether the output sink is multichannel, AudioFlinger may configure legacy output (auxiliary) effects with a multichannel output channel mask in addition to a mono input channel mask. In EFFECT CMD SET CONFIG, they must reject configurations that are not supported.
    1. Verify that int16 is the format.
    2. Verify that the output channel mask is stereo and the mono input channel mask.
  7. Check the legacy code.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads