From 2a4906532f9de4b247349af6f8f75d8931fb9e38 Mon Sep 17 00:00:00 2001 From: henrika Date: Tue, 28 Aug 2018 15:52:10 +0200 Subject: [PATCH] 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 Commit-Queue: Henrik Andreassson Cr-Commit-Position: refs/heads/master@{#24473} --- api/audio/audio_frame.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/audio/audio_frame.h b/api/audio/audio_frame.h index cc078771fa..dd6ac021a7 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 @@ class AudioFrame { // 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), };