aaudio: fix ramp for volume smoothing
It was using numSamples instead of numFrames.
So timing was off.
Bug: 68804159
Test: raise and lower volume without clicking
Test: test_linear_ramp.cpp
Change-Id: I18b10dadbc47ab9cbe9c5aefd4e6197c50a0bedc
diff --git a/media/libaaudio/src/client/AudioStreamInternalPlay.cpp b/media/libaaudio/src/client/AudioStreamInternalPlay.cpp
index 1cf2c72..8d7a01e 100644
--- a/media/libaaudio/src/client/AudioStreamInternalPlay.cpp
+++ b/media/libaaudio/src/client/AudioStreamInternalPlay.cpp
@@ -219,8 +219,7 @@
// Data conversion.
float levelFrom;
float levelTo;
- bool ramping = mVolumeRamp.nextSegment(framesToWrite * getSamplesPerFrame(),
- &levelFrom, &levelTo);
+ bool ramping = mVolumeRamp.nextSegment(framesToWrite, &levelFrom, &levelTo);
// The formats are validated when the stream is opened so we do not have to
// check for illegal combinations here.
// TODO factor this out into a utility function