Increases max size of webrtc::AudioFrame from 60ms to 120ms @32kHz.
Existing max size seems a bit random imho. THis CL extends it from 60ms
to 120ms but the actual goal is to allow usage of 20ms @192kHz since
that is the largest possible sample rate which can be selected on most
platforms.
Recent work on the ADM for Windows ensures that the ADM now supports
192kHz.
Without this change, we will hit DCHECK:s like these:
RTC_DCHECK_LE(bytes_per_sample * number_of_frames * number_of_channels,
AudioFrame::kMaxDataSizeBytes)
when 192kHz is utilized.
Bug: webrtc:9265
Change-Id: Ib4f76a2ecfb1a541776938b8eed801ad64386daa
Reviewed-on: https://webrtc-review.googlesource.com/96542
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24473}
diff --git a/api/audio/audio_frame.h b/api/audio/audio_frame.h
index cc07877..dd6ac02 100644
--- a/api/audio/audio_frame.h
+++ b/api/audio/audio_frame.h
@@ -18,7 +18,7 @@
namespace webrtc {
-/* This class holds up to 60 ms of super-wideband (32 kHz) stereo audio. It
+/* This class holds up to 120 ms of super-wideband (32 kHz) stereo audio. It
* allows for adding and subtracting frames while keeping track of the resulting
* states.
*
@@ -38,8 +38,9 @@
// variables which should allow us to switch to constexpr and keep this a
// header-only class.
enum : size_t {
- // Stereo, 32 kHz, 60 ms (2 * 32 * 60)
- kMaxDataSizeSamples = 3840,
+ // Stereo, 32 kHz, 120 ms (2 * 32 * 120)
+ // Stereo, 192 kHz, 20 ms (2 * 192 * 20)
+ kMaxDataSizeSamples = 7680,
kMaxDataSizeBytes = kMaxDataSizeSamples * sizeof(int16_t),
};