From fc4668dae26e1c9ad40eb75919e7e733251fda4b Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 16 Jul 2020 17:22:03 +0200 Subject: [PATCH] configure target bitrate in opus dtx tests This avoids a difference in behaviour between mobile and desktop platforms since the bitrate is now too low for CELT mode. BUG=webrtc:11643 Change-Id: I9ac1439bea0ccbbfee7388516932e30d6cb06bf4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179522 Reviewed-by: Minyue Li Commit-Queue: Philipp Hancke Cr-Commit-Position: refs/heads/master@{#31757} --- modules/audio_coding/test/TestVADDTX.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/audio_coding/test/TestVADDTX.cc b/modules/audio_coding/test/TestVADDTX.cc index 6c9b14ddb7..dce5433ed8 100644 --- a/modules/audio_coding/test/TestVADDTX.cc +++ b/modules/audio_coding/test/TestVADDTX.cc @@ -267,16 +267,15 @@ void TestOpusDtx::Perform() { acm_send_->ModifyEncoder([](std::unique_ptr* encoder_ptr) { (*encoder_ptr)->SetDtx(true); + // The default bitrate will not generate frames recognized as CN on desktop + // since the frames will be encoded as CELT. Set a low target bitrate to get + // consistent behaviour across platforms. + (*encoder_ptr)->OnReceivedTargetAudioBitrate(24000); }); expects[static_cast(AudioFrameType::kEmptyFrame)] = 1; expects[static_cast(AudioFrameType::kAudioFrameSpeech)] = 1; - // Android and iOS behave different with respect to the number of CN frames. -#if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID) expects[static_cast(AudioFrameType::kAudioFrameCN)] = 1; -#else - expects[static_cast(AudioFrameType::kAudioFrameCN)] = 0; -#endif Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), 32000, 2, out_filename, true, expects); }