blob: abc84b207323d288ff3c8b788c27366c3e45d9e7 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.org9dc45da2012-05-23 15:39:01 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
kjellander3e6db232015-11-26 04:44:54 -080011#include "webrtc/modules/audio_coding/test/iSACTest.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000012
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000013#include <ctype.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000014#include <stdio.h>
15#include <string.h>
16
17#if _WIN32
18#include <windows.h>
19#elif WEBRTC_LINUX
pbos@webrtc.org12dc1a32013-08-05 16:22:53 +000020#include <time.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000021#else
22#include <sys/time.h>
23#include <time.h>
andrew@webrtc.org89df0922013-09-12 01:27:43 +000024#endif
niklase@google.com470e71d2011-07-07 08:21:25 +000025
kjellander3e6db232015-11-26 04:44:54 -080026#include "webrtc/modules/audio_coding/acm2/acm_common_defs.h"
27#include "webrtc/modules/audio_coding/test/utility.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010028#include "webrtc/system_wrappers/include/event_wrapper.h"
Henrik Kjellander98f53512015-10-28 18:17:40 +010029#include "webrtc/system_wrappers/include/trace.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000030#include "webrtc/test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000031
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000032namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000033
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000034void SetISACConfigDefault(ACMTestISACConfig& isacConfig) {
35 isacConfig.currentRateBitPerSec = 0;
36 isacConfig.currentFrameSizeMsec = 0;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000037 isacConfig.encodingMode = -1;
38 isacConfig.initRateBitPerSec = 0;
39 isacConfig.initFrameSizeInMsec = 0;
40 isacConfig.enforceFrameSize = false;
41 return;
niklase@google.com470e71d2011-07-07 08:21:25 +000042}
43
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000044int16_t SetISAConfig(ACMTestISACConfig& isacConfig, AudioCodingModule* acm,
45 int testMode) {
niklase@google.com470e71d2011-07-07 08:21:25 +000046
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000047 if ((isacConfig.currentRateBitPerSec != 0)
48 || (isacConfig.currentFrameSizeMsec != 0)) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080049 auto sendCodec = acm->SendCodec();
50 EXPECT_TRUE(sendCodec);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000051 if (isacConfig.currentRateBitPerSec < 0) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000052 // Register iSAC in adaptive (channel-dependent) mode.
kwiberg1fd4a4a2015-11-03 11:20:50 -080053 sendCodec->rate = -1;
54 EXPECT_EQ(0, acm->RegisterSendCodec(*sendCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000055 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056 if (isacConfig.currentRateBitPerSec != 0) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080057 sendCodec->rate = isacConfig.currentRateBitPerSec;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000058 }
59 if (isacConfig.currentFrameSizeMsec != 0) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080060 sendCodec->pacsize = isacConfig.currentFrameSizeMsec
61 * (sendCodec->plfreq / 1000);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000062 }
kwiberg1fd4a4a2015-11-03 11:20:50 -080063 EXPECT_EQ(0, acm->RegisterSendCodec(*sendCodec));
niklase@google.com470e71d2011-07-07 08:21:25 +000064 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000065 }
niklase@google.com470e71d2011-07-07 08:21:25 +000066
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000067 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000068}
69
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000070ISACTest::ISACTest(int testMode)
71 : _acmA(AudioCodingModule::Create(1)),
72 _acmB(AudioCodingModule::Create(2)),
73 _testMode(testMode) {}
niklase@google.com470e71d2011-07-07 08:21:25 +000074
turaj@webrtc.org55e17232013-10-29 04:40:09 +000075ISACTest::~ISACTest() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000076
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000077void ISACTest::Setup() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000078 int codecCntr;
79 CodecInst codecParam;
niklase@google.com470e71d2011-07-07 08:21:25 +000080
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000081 for (codecCntr = 0; codecCntr < AudioCodingModule::NumberOfCodecs();
82 codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000083 EXPECT_EQ(0, AudioCodingModule::Codec(codecCntr, &codecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000084 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
85 && codecParam.plfreq == 16000) {
86 memcpy(&_paramISAC16kHz, &codecParam, sizeof(CodecInst));
87 _idISAC16kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000088 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000089 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
90 && codecParam.plfreq == 32000) {
91 memcpy(&_paramISAC32kHz, &codecParam, sizeof(CodecInst));
92 _idISAC32kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000093 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000094 }
niklase@google.com470e71d2011-07-07 08:21:25 +000095
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000096 // Register both iSAC-wb & iSAC-swb in both sides as receiver codecs.
97 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC16kHz));
98 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC32kHz));
99 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC16kHz));
100 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC32kHz));
niklase@google.com470e71d2011-07-07 08:21:25 +0000101
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000102 //--- Set A-to-B channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000103 _channel_A2B.reset(new Channel);
104 EXPECT_EQ(0, _acmA->RegisterTransportCallback(_channel_A2B.get()));
105 _channel_A2B->RegisterReceiverACM(_acmB.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000106
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000107 //--- Set B-to-A channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000108 _channel_B2A.reset(new Channel);
109 EXPECT_EQ(0, _acmB->RegisterTransportCallback(_channel_B2A.get()));
110 _channel_B2A->RegisterReceiverACM(_acmA.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000111
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000112 file_name_swb_ = webrtc::test::ResourcePath("audio_coding/testfile32kHz",
113 "pcm");
niklase@google.com470e71d2011-07-07 08:21:25 +0000114
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000115 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
116 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000117
118 _inFileA.Open(file_name_swb_, 32000, "rb");
Henrik Lundin4d682082015-12-10 16:24:39 +0100119 // Set test length to 500 ms (50 blocks of 10 ms each).
120 _inFileA.SetNum10MsBlocksToRead(50);
121 // Fast-forward 1 second (100 blocks) since the files start with silence.
122 _inFileA.FastForward(100);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000123 std::string fileNameA = webrtc::test::OutputPath() + "testisac_a.pcm";
124 std::string fileNameB = webrtc::test::OutputPath() + "testisac_b.pcm";
125 _outFileA.Open(fileNameA, 32000, "wb");
126 _outFileB.Open(fileNameB, 32000, "wb");
127
128 while (!_inFileA.EndOfFile()) {
129 Run10ms();
130 }
131 CodecInst receiveCodec;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000132 EXPECT_EQ(0, _acmA->ReceiveCodec(&receiveCodec));
133 EXPECT_EQ(0, _acmB->ReceiveCodec(&receiveCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000134
135 _inFileA.Close();
136 _outFileA.Close();
137 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000138}
139
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000140void ISACTest::Perform() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000141 Setup();
niklase@google.com470e71d2011-07-07 08:21:25 +0000142
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000143 int16_t testNr = 0;
144 ACMTestISACConfig wbISACConfig;
145 ACMTestISACConfig swbISACConfig;
niklase@google.com470e71d2011-07-07 08:21:25 +0000146
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000147 SetISACConfigDefault(wbISACConfig);
148 SetISACConfigDefault(swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000149
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000150 wbISACConfig.currentRateBitPerSec = -1;
151 swbISACConfig.currentRateBitPerSec = -1;
152 testNr++;
153 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
154
155 if (_testMode != 0) {
niklase@google.com470e71d2011-07-07 08:21:25 +0000156 SetISACConfigDefault(wbISACConfig);
157 SetISACConfigDefault(swbISACConfig);
158
159 wbISACConfig.currentRateBitPerSec = -1;
160 swbISACConfig.currentRateBitPerSec = -1;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000161 wbISACConfig.initRateBitPerSec = 13000;
162 wbISACConfig.initFrameSizeInMsec = 60;
163 swbISACConfig.initRateBitPerSec = 20000;
164 swbISACConfig.initFrameSizeInMsec = 30;
niklase@google.com470e71d2011-07-07 08:21:25 +0000165 testNr++;
166 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
167
niklase@google.com470e71d2011-07-07 08:21:25 +0000168 SetISACConfigDefault(wbISACConfig);
169 SetISACConfigDefault(swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000170
171 wbISACConfig.currentRateBitPerSec = 20000;
172 swbISACConfig.currentRateBitPerSec = 48000;
niklase@google.com470e71d2011-07-07 08:21:25 +0000173 testNr++;
174 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000175
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000176 wbISACConfig.currentRateBitPerSec = 16000;
177 swbISACConfig.currentRateBitPerSec = 30000;
178 wbISACConfig.currentFrameSizeMsec = 60;
niklase@google.com470e71d2011-07-07 08:21:25 +0000179 testNr++;
180 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000181 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000182
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000183 SetISACConfigDefault(wbISACConfig);
184 SetISACConfigDefault(swbISACConfig);
185 testNr++;
186 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000187
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000188 testNr++;
189 if (_testMode == 0) {
190 SwitchingSamplingRate(testNr, 4);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000191 } else {
192 SwitchingSamplingRate(testNr, 80);
193 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000194}
195
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000196void ISACTest::Run10ms() {
197 AudioFrame audioFrame;
198 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
henrik.lundin@webrtc.orgf56c1622015-03-02 12:29:30 +0000199 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0);
200 EXPECT_GE(_acmB->Add10MsData(audioFrame), 0);
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000201 EXPECT_EQ(0, _acmA->PlayoutData10Ms(32000, &audioFrame));
202 _outFileA.Write10MsData(audioFrame);
203 EXPECT_EQ(0, _acmB->PlayoutData10Ms(32000, &audioFrame));
204 _outFileB.Write10MsData(audioFrame);
205}
206
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000207void ISACTest::EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
208 ACMTestISACConfig& swbISACConfig) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000209 // Files in Side A and B
210 _inFileA.Open(file_name_swb_, 32000, "rb", true);
211 _inFileB.Open(file_name_swb_, 32000, "rb", true);
212
213 std::string file_name_out;
214 std::stringstream file_stream_a;
215 std::stringstream file_stream_b;
216 file_stream_a << webrtc::test::OutputPath();
217 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000218 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
219 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000220 file_name_out = file_stream_a.str();
221 _outFileA.Open(file_name_out, 32000, "wb");
222 file_name_out = file_stream_b.str();
223 _outFileB.Open(file_name_out, 32000, "wb");
224
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000225 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
226 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
227 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
228 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000229
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000230 // Side A is sending super-wideband, and side B is sending wideband.
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000231 SetISAConfig(swbISACConfig, _acmA.get(), _testMode);
232 SetISAConfig(wbISACConfig, _acmB.get(), _testMode);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000233
234 bool adaptiveMode = false;
235 if ((swbISACConfig.currentRateBitPerSec == -1)
236 || (wbISACConfig.currentRateBitPerSec == -1)) {
237 adaptiveMode = true;
238 }
239 _myTimer.Reset();
240 _channel_A2B->ResetStats();
241 _channel_B2A->ResetStats();
242
243 char currentTime[500];
Peter Boström64c03662015-04-08 11:24:19 +0200244 EventTimerWrapper* myEvent = EventTimerWrapper::Create();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000245 EXPECT_TRUE(myEvent->StartTimer(true, 10));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000246 while (!(_inFileA.EndOfFile() || _inFileA.Rewinded())) {
247 Run10ms();
248 _myTimer.Tick10ms();
249 _myTimer.CurrentTimeHMS(currentTime);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000250
251 if ((adaptiveMode) && (_testMode != 0)) {
252 myEvent->Wait(5000);
kwiberg1fd4a4a2015-11-03 11:20:50 -0800253 EXPECT_TRUE(_acmA->SendCodec());
254 EXPECT_TRUE(_acmB->SendCodec());
niklase@google.com470e71d2011-07-07 08:21:25 +0000255 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000256 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000257
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000258 if (_testMode != 0) {
259 printf("\n\nSide A statistics\n\n");
260 _channel_A2B->PrintStats(_paramISAC32kHz);
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000261
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000262 printf("\n\nSide B statistics\n\n");
263 _channel_B2A->PrintStats(_paramISAC16kHz);
264 }
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000265
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000266 _channel_A2B->ResetStats();
267 _channel_B2A->ResetStats();
268
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000269 _outFileA.Close();
270 _outFileB.Close();
271 _inFileA.Close();
272 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000273}
274
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000275void ISACTest::SwitchingSamplingRate(int testNr, int maxSampRateChange) {
276 // Files in Side A
277 _inFileA.Open(file_name_swb_, 32000, "rb");
278 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000279
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000280 std::string file_name_out;
281 std::stringstream file_stream_a;
282 std::stringstream file_stream_b;
283 file_stream_a << webrtc::test::OutputPath();
284 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000285 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
286 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000287 file_name_out = file_stream_a.str();
288 _outFileA.Open(file_name_out, 32000, "wb");
289 file_name_out = file_stream_b.str();
290 _outFileB.Open(file_name_out, 32000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000291
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000292 // Start with side A sending super-wideband and side B seding wideband.
293 // Toggle sending wideband/super-wideband in this test.
294 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
295 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000296
297 int numSendCodecChanged = 0;
298 _myTimer.Reset();
299 char currentTime[50];
300 while (numSendCodecChanged < (maxSampRateChange << 1)) {
301 Run10ms();
302 _myTimer.Tick10ms();
303 _myTimer.CurrentTimeHMS(currentTime);
304 if (_testMode == 2)
305 printf("\r%s", currentTime);
306 if (_inFileA.EndOfFile()) {
307 if (_inFileA.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000308 // Switch side A to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000309 _inFileA.Close();
310 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000311 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000312 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000313 // Switch side A to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000314 _inFileA.Close();
315 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000316 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000317 }
318 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000319 }
320
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000321 if (_inFileB.EndOfFile()) {
322 if (_inFileB.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000323 // Switch side B to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000324 _inFileB.Close();
325 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000326 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000327 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000328 // Switch side B to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000329 _inFileB.Close();
330 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000331 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000332 }
333 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000334 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000335 }
336 _outFileA.Close();
337 _outFileB.Close();
338 _inFileA.Close();
339 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000340}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000341
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000342} // namespace webrtc