From a1f0113d79ff3ed151fe5592e9f9687a6c711e49 Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Mon, 18 Apr 2022 18:28:24 +0000 Subject: [PATCH] Visualizer: update docs for the RMS measurements Indicate that the effect can return >0 dBFS RMS reading when used on the global session. Update the expected minimum value. Bug: 202015438 Test: m Change-Id: Ied49b690eebfca8cd98ebfbc529a014e9321c811 --- media/java/android/media/audiofx/Visualizer.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/media/java/android/media/audiofx/Visualizer.java b/media/java/android/media/audiofx/Visualizer.java index 3349277ede3b3..ea4027eab1589 100644 --- a/media/java/android/media/audiofx/Visualizer.java +++ b/media/java/android/media/audiofx/Visualizer.java @@ -110,10 +110,18 @@ public class Visualizer { public static final int MEASUREMENT_MODE_NONE = 0; /** - * Defines a measurement mode which computes the peak and RMS value in mB, where 0mB is the - * maximum sample value, and -9600mB is the minimum value. - * Values for peak and RMS can be retrieved with - * {@link #getMeasurementPeakRms(MeasurementPeakRms)}. + * Defines a measurement mode which computes the peak and RMS value in mB below the + * "full scale", where 0mB is normally the maximum sample value (but see the note + * below). Minimum value depends on the resolution of audio samples used by the audio + * framework. The value of -9600mB is the minimum value for 16-bit audio systems and + * -14400mB or below for "high resolution" systems. Values for peak and RMS can be + * retrieved with {@link #getMeasurementPeakRms(MeasurementPeakRms)}. + * + *

Note: when Visualizer effect is attached to the + * global session (with session ID 0), it is possible to observe RMS peaks higher than + * 0 dBFS, for example in the case when there are multiple audio sources playing + * simultaneously. In this case {@link #getMeasurementPeakRms(MeasurementPeakRms)} + * method can return a positive value. */ public static final int MEASUREMENT_MODE_PEAK_RMS = 1 << 0;