blob: 9f223fb81fb6a8e12d53306759e19e0387f0f10e [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"
29#include "webrtc/system_wrappers/include/tick_util.h"
30#include "webrtc/system_wrappers/include/trace.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000031#include "webrtc/test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000032
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000033namespace webrtc {
niklase@google.com470e71d2011-07-07 08:21:25 +000034
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000035void SetISACConfigDefault(ACMTestISACConfig& isacConfig) {
36 isacConfig.currentRateBitPerSec = 0;
37 isacConfig.currentFrameSizeMsec = 0;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000038 isacConfig.encodingMode = -1;
39 isacConfig.initRateBitPerSec = 0;
40 isacConfig.initFrameSizeInMsec = 0;
41 isacConfig.enforceFrameSize = false;
42 return;
niklase@google.com470e71d2011-07-07 08:21:25 +000043}
44
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000045int16_t SetISAConfig(ACMTestISACConfig& isacConfig, AudioCodingModule* acm,
46 int testMode) {
niklase@google.com470e71d2011-07-07 08:21:25 +000047
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000048 if ((isacConfig.currentRateBitPerSec != 0)
49 || (isacConfig.currentFrameSizeMsec != 0)) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080050 auto sendCodec = acm->SendCodec();
51 EXPECT_TRUE(sendCodec);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000052 if (isacConfig.currentRateBitPerSec < 0) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000053 // Register iSAC in adaptive (channel-dependent) mode.
kwiberg1fd4a4a2015-11-03 11:20:50 -080054 sendCodec->rate = -1;
55 EXPECT_EQ(0, acm->RegisterSendCodec(*sendCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000056 } else {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000057 if (isacConfig.currentRateBitPerSec != 0) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080058 sendCodec->rate = isacConfig.currentRateBitPerSec;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000059 }
60 if (isacConfig.currentFrameSizeMsec != 0) {
kwiberg1fd4a4a2015-11-03 11:20:50 -080061 sendCodec->pacsize = isacConfig.currentFrameSizeMsec
62 * (sendCodec->plfreq / 1000);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000063 }
kwiberg1fd4a4a2015-11-03 11:20:50 -080064 EXPECT_EQ(0, acm->RegisterSendCodec(*sendCodec));
niklase@google.com470e71d2011-07-07 08:21:25 +000065 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000066 }
niklase@google.com470e71d2011-07-07 08:21:25 +000067
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000068 return 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000069}
70
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000071ISACTest::ISACTest(int testMode)
72 : _acmA(AudioCodingModule::Create(1)),
73 _acmB(AudioCodingModule::Create(2)),
74 _testMode(testMode) {}
niklase@google.com470e71d2011-07-07 08:21:25 +000075
turaj@webrtc.org55e17232013-10-29 04:40:09 +000076ISACTest::~ISACTest() {}
niklase@google.com470e71d2011-07-07 08:21:25 +000077
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000078void ISACTest::Setup() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000079 int codecCntr;
80 CodecInst codecParam;
niklase@google.com470e71d2011-07-07 08:21:25 +000081
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000082 for (codecCntr = 0; codecCntr < AudioCodingModule::NumberOfCodecs();
83 codecCntr++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000084 EXPECT_EQ(0, AudioCodingModule::Codec(codecCntr, &codecParam));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000085 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
86 && codecParam.plfreq == 16000) {
87 memcpy(&_paramISAC16kHz, &codecParam, sizeof(CodecInst));
88 _idISAC16kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000089 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000090 if (!STR_CASE_CMP(codecParam.plname, "ISAC")
91 && codecParam.plfreq == 32000) {
92 memcpy(&_paramISAC32kHz, &codecParam, sizeof(CodecInst));
93 _idISAC32kHz = codecCntr;
niklase@google.com470e71d2011-07-07 08:21:25 +000094 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000095 }
niklase@google.com470e71d2011-07-07 08:21:25 +000096
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000097 // Register both iSAC-wb & iSAC-swb in both sides as receiver codecs.
98 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC16kHz));
99 EXPECT_EQ(0, _acmA->RegisterReceiveCodec(_paramISAC32kHz));
100 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC16kHz));
101 EXPECT_EQ(0, _acmB->RegisterReceiveCodec(_paramISAC32kHz));
niklase@google.com470e71d2011-07-07 08:21:25 +0000102
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000103 //--- Set A-to-B channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000104 _channel_A2B.reset(new Channel);
105 EXPECT_EQ(0, _acmA->RegisterTransportCallback(_channel_A2B.get()));
106 _channel_A2B->RegisterReceiverACM(_acmB.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000107
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000108 //--- Set B-to-A channel
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000109 _channel_B2A.reset(new Channel);
110 EXPECT_EQ(0, _acmB->RegisterTransportCallback(_channel_B2A.get()));
111 _channel_B2A->RegisterReceiverACM(_acmA.get());
niklase@google.com470e71d2011-07-07 08:21:25 +0000112
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000113 file_name_swb_ = webrtc::test::ResourcePath("audio_coding/testfile32kHz",
114 "pcm");
niklase@google.com470e71d2011-07-07 08:21:25 +0000115
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000116 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
117 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000118
119 _inFileA.Open(file_name_swb_, 32000, "rb");
Henrik Lundin4d682082015-12-10 16:24:39 +0100120 // Set test length to 500 ms (50 blocks of 10 ms each).
121 _inFileA.SetNum10MsBlocksToRead(50);
122 // Fast-forward 1 second (100 blocks) since the files start with silence.
123 _inFileA.FastForward(100);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000124 std::string fileNameA = webrtc::test::OutputPath() + "testisac_a.pcm";
125 std::string fileNameB = webrtc::test::OutputPath() + "testisac_b.pcm";
126 _outFileA.Open(fileNameA, 32000, "wb");
127 _outFileB.Open(fileNameB, 32000, "wb");
128
129 while (!_inFileA.EndOfFile()) {
130 Run10ms();
131 }
132 CodecInst receiveCodec;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000133 EXPECT_EQ(0, _acmA->ReceiveCodec(&receiveCodec));
134 EXPECT_EQ(0, _acmB->ReceiveCodec(&receiveCodec));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000135
136 _inFileA.Close();
137 _outFileA.Close();
138 _outFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000139}
140
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000141void ISACTest::Perform() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000142 Setup();
niklase@google.com470e71d2011-07-07 08:21:25 +0000143
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000144 int16_t testNr = 0;
145 ACMTestISACConfig wbISACConfig;
146 ACMTestISACConfig swbISACConfig;
niklase@google.com470e71d2011-07-07 08:21:25 +0000147
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000148 SetISACConfigDefault(wbISACConfig);
149 SetISACConfigDefault(swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000150
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000151 wbISACConfig.currentRateBitPerSec = -1;
152 swbISACConfig.currentRateBitPerSec = -1;
153 testNr++;
154 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
155
156 if (_testMode != 0) {
niklase@google.com470e71d2011-07-07 08:21:25 +0000157 SetISACConfigDefault(wbISACConfig);
158 SetISACConfigDefault(swbISACConfig);
159
160 wbISACConfig.currentRateBitPerSec = -1;
161 swbISACConfig.currentRateBitPerSec = -1;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000162 wbISACConfig.initRateBitPerSec = 13000;
163 wbISACConfig.initFrameSizeInMsec = 60;
164 swbISACConfig.initRateBitPerSec = 20000;
165 swbISACConfig.initFrameSizeInMsec = 30;
niklase@google.com470e71d2011-07-07 08:21:25 +0000166 testNr++;
167 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
168
niklase@google.com470e71d2011-07-07 08:21:25 +0000169 SetISACConfigDefault(wbISACConfig);
170 SetISACConfigDefault(swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000171
172 wbISACConfig.currentRateBitPerSec = 20000;
173 swbISACConfig.currentRateBitPerSec = 48000;
niklase@google.com470e71d2011-07-07 08:21:25 +0000174 testNr++;
175 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000176
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000177 wbISACConfig.currentRateBitPerSec = 16000;
178 swbISACConfig.currentRateBitPerSec = 30000;
179 wbISACConfig.currentFrameSizeMsec = 60;
niklase@google.com470e71d2011-07-07 08:21:25 +0000180 testNr++;
181 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000182 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000183
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000184 SetISACConfigDefault(wbISACConfig);
185 SetISACConfigDefault(swbISACConfig);
186 testNr++;
187 EncodeDecode(testNr, wbISACConfig, swbISACConfig);
niklase@google.com470e71d2011-07-07 08:21:25 +0000188
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000189 testNr++;
190 if (_testMode == 0) {
191 SwitchingSamplingRate(testNr, 4);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000192 } else {
193 SwitchingSamplingRate(testNr, 80);
194 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000195}
196
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000197void ISACTest::Run10ms() {
198 AudioFrame audioFrame;
199 EXPECT_GT(_inFileA.Read10MsData(audioFrame), 0);
henrik.lundin@webrtc.orgf56c1622015-03-02 12:29:30 +0000200 EXPECT_GE(_acmA->Add10MsData(audioFrame), 0);
201 EXPECT_GE(_acmB->Add10MsData(audioFrame), 0);
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000202 EXPECT_EQ(0, _acmA->PlayoutData10Ms(32000, &audioFrame));
203 _outFileA.Write10MsData(audioFrame);
204 EXPECT_EQ(0, _acmB->PlayoutData10Ms(32000, &audioFrame));
205 _outFileB.Write10MsData(audioFrame);
206}
207
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000208void ISACTest::EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
209 ACMTestISACConfig& swbISACConfig) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000210 // Files in Side A and B
211 _inFileA.Open(file_name_swb_, 32000, "rb", true);
212 _inFileB.Open(file_name_swb_, 32000, "rb", true);
213
214 std::string file_name_out;
215 std::stringstream file_stream_a;
216 std::stringstream file_stream_b;
217 file_stream_a << webrtc::test::OutputPath();
218 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000219 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
220 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000221 file_name_out = file_stream_a.str();
222 _outFileA.Open(file_name_out, 32000, "wb");
223 file_name_out = file_stream_b.str();
224 _outFileB.Open(file_name_out, 32000, "wb");
225
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000226 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
227 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
228 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
229 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000230
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000231 // Side A is sending super-wideband, and side B is sending wideband.
turaj@webrtc.org55e17232013-10-29 04:40:09 +0000232 SetISAConfig(swbISACConfig, _acmA.get(), _testMode);
233 SetISAConfig(wbISACConfig, _acmB.get(), _testMode);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000234
235 bool adaptiveMode = false;
236 if ((swbISACConfig.currentRateBitPerSec == -1)
237 || (wbISACConfig.currentRateBitPerSec == -1)) {
238 adaptiveMode = true;
239 }
240 _myTimer.Reset();
241 _channel_A2B->ResetStats();
242 _channel_B2A->ResetStats();
243
244 char currentTime[500];
Peter Boström64c03662015-04-08 11:24:19 +0200245 EventTimerWrapper* myEvent = EventTimerWrapper::Create();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000246 EXPECT_TRUE(myEvent->StartTimer(true, 10));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000247 while (!(_inFileA.EndOfFile() || _inFileA.Rewinded())) {
248 Run10ms();
249 _myTimer.Tick10ms();
250 _myTimer.CurrentTimeHMS(currentTime);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000251
252 if ((adaptiveMode) && (_testMode != 0)) {
253 myEvent->Wait(5000);
kwiberg1fd4a4a2015-11-03 11:20:50 -0800254 EXPECT_TRUE(_acmA->SendCodec());
255 EXPECT_TRUE(_acmB->SendCodec());
niklase@google.com470e71d2011-07-07 08:21:25 +0000256 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000257 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000258
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000259 if (_testMode != 0) {
260 printf("\n\nSide A statistics\n\n");
261 _channel_A2B->PrintStats(_paramISAC32kHz);
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000262
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000263 printf("\n\nSide B statistics\n\n");
264 _channel_B2A->PrintStats(_paramISAC16kHz);
265 }
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000266
andresp@webrtc.orgd0b436a2014-01-13 13:15:59 +0000267 _channel_A2B->ResetStats();
268 _channel_B2A->ResetStats();
269
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000270 _outFileA.Close();
271 _outFileB.Close();
272 _inFileA.Close();
273 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000274}
275
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000276void ISACTest::SwitchingSamplingRate(int testNr, int maxSampRateChange) {
277 // Files in Side A
278 _inFileA.Open(file_name_swb_, 32000, "rb");
279 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000280
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000281 std::string file_name_out;
282 std::stringstream file_stream_a;
283 std::stringstream file_stream_b;
284 file_stream_a << webrtc::test::OutputPath();
285 file_stream_b << webrtc::test::OutputPath();
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000286 file_stream_a << "out_iSACTest_A_" << testNr << ".pcm";
287 file_stream_b << "out_iSACTest_B_" << testNr << ".pcm";
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000288 file_name_out = file_stream_a.str();
289 _outFileA.Open(file_name_out, 32000, "wb");
290 file_name_out = file_stream_b.str();
291 _outFileB.Open(file_name_out, 32000, "wb");
niklase@google.com470e71d2011-07-07 08:21:25 +0000292
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000293 // Start with side A sending super-wideband and side B seding wideband.
294 // Toggle sending wideband/super-wideband in this test.
295 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
296 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000297
298 int numSendCodecChanged = 0;
299 _myTimer.Reset();
300 char currentTime[50];
301 while (numSendCodecChanged < (maxSampRateChange << 1)) {
302 Run10ms();
303 _myTimer.Tick10ms();
304 _myTimer.CurrentTimeHMS(currentTime);
305 if (_testMode == 2)
306 printf("\r%s", currentTime);
307 if (_inFileA.EndOfFile()) {
308 if (_inFileA.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000309 // Switch side A to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000310 _inFileA.Close();
311 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000312 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000313 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000314 // Switch side A to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000315 _inFileA.Close();
316 _inFileA.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000317 EXPECT_EQ(0, _acmA->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000318 }
319 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000320 }
321
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000322 if (_inFileB.EndOfFile()) {
323 if (_inFileB.SamplingFrequency() == 16000) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000324 // Switch side B to send super-wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000325 _inFileB.Close();
326 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000327 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC32kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000328 } else {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000329 // Switch side B to send wideband.
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000330 _inFileB.Close();
331 _inFileB.Open(file_name_swb_, 32000, "rb");
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000332 EXPECT_EQ(0, _acmB->RegisterSendCodec(_paramISAC16kHz));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000333 }
334 numSendCodecChanged++;
niklase@google.com470e71d2011-07-07 08:21:25 +0000335 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000336 }
337 _outFileA.Close();
338 _outFileB.Close();
339 _inFileA.Close();
340 _inFileB.Close();
niklase@google.com470e71d2011-07-07 08:21:25 +0000341}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000342
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000343} // namespace webrtc