2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
ハイ レゾリューション オーディオ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 10 リリースでは、ハイ レゾリューション オーディオに関して以下の点が改善されています。
- float: WAV、FLAC コーデック、エクストラクタが、float(24 ビット以上の可逆精度)をサポートするように更新されます。Downmix と Virtualizer のエフェクトが float に更新されます。
更新された精度は、MediaPlayer(NuPlayer)によって許可されます。
- 高周波数: WAV、FLAC コーデック、エクストラクタが 192 kHz に対応するように更新されます。
Android によるデフォルトのエフェクトにおける 192 kHz への対応については、標準周波数でテストされています。
許可される標準周波数は 88.2 kHz、96 kHz、176.4 kHz、192 kHz です。
- マルチチャンネル: Android のデフォルトの再生エフェクトにおけるマルチチャンネル対応については、8 チャンネルでテストされています。
- タイミング: オーディオ フレームワーク全体にタイミング情報が含まれます。
Android 9 以降では、以下の点が改善されており、パートナー側での実装が不要になります。
- 同時クライアント出力トラックの数が 14 から 40 に増えます。Android 8.x アプリでは
AudioTrack
のクライアント インスタンスに上限があり、問題になっていました。
- クライアント メモリとサーバーメモリの最大サイズが 4 MB から 32 MB(デバイスのメモリの合計により変化)に増加し、ハイ レゾリューション オーディオ トラックの同時再生が可能になります。
- 合計ミックス トラック数が 32 から 256 に増え、アプリとシステム UI 間のリソースの競合が回避されます。
出力エフェクトの変更
Android 11 リリースの変更点については、オーディオ エフェクトをご覧ください。
Android 9 より前のリリースでは、エフェクト チェーン処理がステレオ int16 サンプル形式で実装されており、いくつか制限がありました。
- すべての出力エフェクトが浮動小数点オーディオ データから int16 形式に変換されることで、精度が低下していました。
- チャンネル数が 2 より大きい出力シンクでは、出力エフェクトが拒否されていました。
Android 9 リリースでは、エフェクト チェーン処理のパイプラインがアップグレードされており、マルチチャンネルでの float 形式に対応します。主なポイントは以下のとおりです。
- Android ソフトウェアのエフェクトは、すでにステレオ float 形式に移行済です。
- 以前のエフェクトはフォーマット アダプターでサポートされ、必要に応じて float 形式が int16 形式に変換されます。
出力エフェクトの実装
出力エフェクトのリファレンス実装は frameworks/av/media/libeffects
から利用できます。
独自のカスタム出力エフェクトを実装するパートナーは、Android 10 リリースの場合、以下を行う必要があります。
- 出力エフェクトを更新して、マルチチャンネルの float 形式に対応します。
- Int16 処理への対応は不要になりました。
- 2~8 の出力チャンネル数をサポートします(今後の互換性を確保するために、1~30 のチャンネル数を検討してください)。
- 挿入エフェクトの出力チャンネル数に一致する入力チャンネル数をサポートします。AUX エフェクトでは、入力チャンネル数が 1(モノラル)のままになります。
- チャンネル ポジションのマスク(正規化)と
(1 << n) - 1
のチャンネル インデックスのマスクの両方をサポートします。
- 以前のベンダーの出力エフェクトを引き続きサポートする必要があり、エフェクトを更新できない場合は、以前のコードについて以下の点を検証します。
- 以前の出力(挿入)エフェクトでは、
EFFECT_CMD_SET_CONFIG
でサポートされていない設定を拒否する必要があります。
- 形式が int16 であることを確認します。
- 入力と出力のチャンネル マスクがステレオであることを確認します。
- いずれかのチェックに失敗する場合は、
-EINVAL
を返します。
- 以前の出力(AUX)エフェクトは AudioFlinger で設定します。出力シンクがマルチチャンネルかどうかに合わせて、モノラル入力チャンネル マスクとマルチチャンネルの出力チャンネル マスク(必要な場合)を使用します。
EFFECT_CMD_SET_CONFIG
でサポートされていない設定については、拒否する必要があります。
- 形式が int16 であることを確認します。
- 入力チャンネル マスクがモノラルで、出力チャンネル マスクがステレオであることを確認します。
- いずれかのチェックに失敗する場合は、
-EINVAL
を返します。
- 以前のコードを検証します。動作しない可能性も想定しておきます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 UTC。
[null,null,["最終更新日 2025-03-26 UTC。"],[],[],null,["# High-resolution audio\n\nThe Android 10 release includes the following\nimprovements for high-resolution audio:\n\n- **Float:** WAV, FLAC codecs, and extractors are updated to support float (24+ bits of lossless precision). Downmix and Virtualizer effects are updated to float. Updated precision is allowed by MediaPlayer (NuPlayer).\n- **High-frequency:** WAV, FLAC codecs, and extractors are updated to support 192 kHz. The default Android supplied effects are tested for 192 kHz support at standard frequencies. The standard frequencies permitted are 88.2 kHz, 96 kHz, 176.4 kHz, and 192 kHz.\n- **Multichannel:** Default Android playback effects are tested for multichannel support to eight channels.\n- **Timing:** Timing information is included throughout the audio framework.\n\nStarting in Android 9, the following improvements\ndon't require any partner implementation:\n\n- The number of simultaneous client output tracks increases from 14 to 40, as limited client instances of `AudioTrack` have been an issue for apps in Android 8.x.\n- Maximum client/server memory increases from 4 MB to 32 MB (depending on total device memory) to allow more simultaneous high-resolution audio tracks.\n- Total mixed tracks increases from 32 to 256 to prevent resource contention between apps and the System UI.\n\nOutput effect changes\n---------------------\n\nSee [Audio\neffects](/docs/core/audio/audio-effects) for Android 11 release changes.\n\nPrior to the Android 9 release, effect chain processing\nwas implemented in stereo int16 sample format. This had several limitations:\n\n- All output effects forced conversion from floating point audio data to int16, causing loss of precision.\n- Output effects were rejected from output sinks with a channel count greater than two.\n\nIn the Android 9 release, the effect chain processing\npipeline is upgraded to support the multichannel float format. Key points:\n\n- Android software effects are already migrated to stereo float.\n- Legacy effects are supported with format adapters, which convert float to int16 as needed.\n\nImplement output effects\n------------------------\n\nA reference implementation for output effects is available under\n`frameworks/av/media/libeffects`.\n\nPartners implementing their own custom output effects should do the\nfollowing for the Android 10 release:\n\n- Update output effects to support the multichannel float format:\n - Int16 processing support is no longer required.\n - Support output channel counts from 2--8 (for future compatibility consider counts from 1--30).\n - Support input channel counts matching output channel counts for insert effects. Auxiliary effects continue to see an input channel count of 1 (mono).\n - Support both channel position masks (canonical) and channel index masks of `(1 \u003c\u003c n) - 1`.\n- If you must continue to support legacy vendor output effects and can't update them, then verify legacy code as follows:\n - Legacy output (insert) effects **must reject** unsupported configurations in `EFFECT_CMD_SET_CONFIG`.\n - Check that the format is int16.\n - Check that the input and output channel masks are stereo.\n - If either check fails, return `-EINVAL`.\n - Legacy output (auxiliary) effects are configured by AudioFlinger with a mono input channel mask and potentially multichannel output channel masks, depending on whether the output sink is multichannel. They **must reject** unsupported configurations in `\n EFFECT_CMD_SET_CONFIG`.\n - Check that the format is int16.\n - Check that the input channel mask is mono and the output channel mask is stereo.\n - If either check fails, return `-EINVAL`.\n - Verify legacy code. Don't assume that it works!"]]