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 <minyue@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#31757}
This commit is contained in:
Philipp Hancke
2020-07-16 17:22:03 +02:00
committed by Commit Bot
parent b9d3809418
commit fc4668dae2

View File

@ -267,16 +267,15 @@ void TestOpusDtx::Perform() {
acm_send_->ModifyEncoder([](std::unique_ptr<AudioEncoder>* 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<int>(AudioFrameType::kEmptyFrame)] = 1;
expects[static_cast<int>(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<int>(AudioFrameType::kAudioFrameCN)] = 1;
#else
expects[static_cast<int>(AudioFrameType::kAudioFrameCN)] = 0;
#endif
Run(webrtc::test::ResourcePath("audio_coding/teststereo32kHz", "pcm"), 32000,
2, out_filename, true, expects);
}