Rename FloatResamplingAudioProcessor to ToFloatPcmAudioProcessor.

Resampling as a term is overloaded, however it was raised as a
confusing term in a meeting recently, as the 1P team initially thought
this would change the sample rate. The naming of this `AudioProcessor`
now matches `ToInt16PcmAudioProcessor`.

PiperOrigin-RevId: 503441019
This commit is contained in:
samrobinson 2023-01-20 15:45:19 +00:00 committed by christosts
parent bb11e0286e
commit eda7cd2405
2 changed files with 2 additions and 2 deletions

View File

@ -545,7 +545,7 @@ public final class DefaultAudioSink implements AudioSink {
toIntPcmAvailableAudioProcessors = toIntPcmAvailableAudioProcessors =
ImmutableList.of( ImmutableList.of(
new ToInt16PcmAudioProcessor(), channelMappingAudioProcessor, trimmingAudioProcessor); new ToInt16PcmAudioProcessor(), channelMappingAudioProcessor, trimmingAudioProcessor);
toFloatPcmAvailableAudioProcessors = ImmutableList.of(new FloatResamplingAudioProcessor()); toFloatPcmAvailableAudioProcessors = ImmutableList.of(new ToFloatPcmAudioProcessor());
volume = 1f; volume = 1f;
audioAttributes = AudioAttributes.DEFAULT; audioAttributes = AudioAttributes.DEFAULT;
audioSessionId = C.AUDIO_SESSION_ID_UNSET; audioSessionId = C.AUDIO_SESSION_ID_UNSET;

View File

@ -33,7 +33,7 @@ import java.nio.ByteBuffer;
* <li>{@link C#ENCODING_PCM_FLOAT} ({@link #isActive()} will return {@code false}) * <li>{@link C#ENCODING_PCM_FLOAT} ({@link #isActive()} will return {@code false})
* </ul> * </ul>
*/ */
/* package */ final class FloatResamplingAudioProcessor extends BaseAudioProcessor { /* package */ final class ToFloatPcmAudioProcessor extends BaseAudioProcessor {
private static final int FLOAT_NAN_AS_INT = Float.floatToIntBits(Float.NaN); private static final int FLOAT_NAN_AS_INT = Float.floatToIntBits(Float.NaN);
private static final double PCM_32_BIT_INT_TO_PCM_32_BIT_FLOAT_FACTOR = 1.0 / 0x7FFFFFFF; private static final double PCM_32_BIT_INT_TO_PCM_32_BIT_FLOAT_FACTOR = 1.0 / 0x7FFFFFFF;