blob: c765f685022156fe17761e3dc782fc19557962b3 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tina.legrand@webrtc.orgae1c4542012-03-12 08:41:30 +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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#include "modules/audio_coding/test/EncodeDecodeTest.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000012
kwiberg37478382016-02-14 20:40:57 -080013#include <memory>
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000014#include <sstream>
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000015#include <stdio.h>
niklase@google.com470e71d2011-07-07 08:21:25 +000016#include <stdlib.h>
tina.legrand@webrtc.org5e7ca602012-06-12 07:16:24 +000017
Mirko Bonadei71207422017-09-15 13:58:09 +020018#include "common_types.h" // NOLINT(build/include)
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "modules/audio_coding/codecs/audio_format_conversion.h"
20#include "modules/audio_coding/include/audio_coding_module.h"
21#include "modules/audio_coding/test/utility.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020022#include "test/gtest.h"
23#include "test/testsupport/fileutils.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000024
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000025namespace webrtc {
26
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000027TestPacketization::TestPacketization(RTPStream *rtpStream, uint16_t frequency)
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000028 : _rtpStream(rtpStream),
29 _frequency(frequency),
30 _seqNo(0) {
niklase@google.com470e71d2011-07-07 08:21:25 +000031}
32
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000033TestPacketization::~TestPacketization() {
34}
niklase@google.com470e71d2011-07-07 08:21:25 +000035
pbos@webrtc.org0946a562013-04-09 00:28:06 +000036int32_t TestPacketization::SendData(
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000037 const FrameType /* frameType */, const uint8_t payloadType,
38 const uint32_t timeStamp, const uint8_t* payloadData,
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000039 const size_t payloadSize,
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000040 const RTPFragmentationHeader* /* fragmentation */) {
41 _rtpStream->Write(payloadType, timeStamp, _seqNo++, payloadData, payloadSize,
42 _frequency);
43 return 1;
44}
niklase@google.com470e71d2011-07-07 08:21:25 +000045
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000046Sender::Sender()
47 : _acm(NULL),
48 _pcmFile(),
49 _audioFrame(),
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000050 _packetization(NULL) {
51}
52
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000053void Sender::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
Peter Kasting69558702016-01-12 16:26:35 -080054 std::string in_file_name, int sample_rate, size_t channels) {
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000055 struct CodecInst sendCodec;
56 int noOfCodecs = acm->NumberOfCodecs();
57 int codecNo;
58
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000059 // Open input file
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000060 const std::string file_name = webrtc::test::ResourcePath(in_file_name, "pcm");
61 _pcmFile.Open(file_name, sample_rate, "rb");
62 if (channels == 2) {
63 _pcmFile.ReadStereo(true);
64 }
Henrik Lundin4d682082015-12-10 16:24:39 +010065 // Set test length to 500 ms (50 blocks of 10 ms each).
66 _pcmFile.SetNum10MsBlocksToRead(50);
67 // Fast-forward 1 second (100 blocks) since the file starts with silence.
68 _pcmFile.FastForward(100);
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000069
70 // Set the codec for the current test.
71 if ((testMode == 0) || (testMode == 1)) {
72 // Set the codec id.
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000073 codecNo = codeId;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000074 } else {
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000075 // Choose codec on command line.
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000076 printf("List of supported codec.\n");
77 for (int n = 0; n < noOfCodecs; n++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000078 EXPECT_EQ(0, acm->Codec(n, &sendCodec));
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000079 printf("%d %s\n", n, sendCodec.plname);
niklase@google.com470e71d2011-07-07 08:21:25 +000080 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000081 printf("Choose your codec:");
82 ASSERT_GT(scanf("%d", &codecNo), 0);
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000083 }
84
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000085 EXPECT_EQ(0, acm->Codec(codecNo, &sendCodec));
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +000086
87 sendCodec.channels = channels;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000088
89 EXPECT_EQ(0, acm->RegisterSendCodec(sendCodec));
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000090 _packetization = new TestPacketization(rtpStream, sendCodec.plfreq);
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000091 EXPECT_EQ(0, acm->RegisterTransportCallback(_packetization));
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000092
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000093 _acm = acm;
94}
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000095
96void Sender::Teardown() {
97 _pcmFile.Close();
98 delete _packetization;
niklase@google.com470e71d2011-07-07 08:21:25 +000099}
100
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000101bool Sender::Add10MsData() {
102 if (!_pcmFile.EndOfFile()) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000103 EXPECT_GT(_pcmFile.Read10MsData(_audioFrame), 0);
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000104 int32_t ok = _acm->Add10MsData(_audioFrame);
henrik.lundin@webrtc.orgf56c1622015-03-02 12:29:30 +0000105 EXPECT_GE(ok, 0);
106 return ok >= 0 ? true : false;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000107 }
108 return false;
niklase@google.com470e71d2011-07-07 08:21:25 +0000109}
110
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000111void Sender::Run() {
112 while (true) {
113 if (!Add10MsData()) {
114 break;
niklase@google.com470e71d2011-07-07 08:21:25 +0000115 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000116 }
117}
118
119Receiver::Receiver()
120 : _playoutLengthSmpls(WEBRTC_10MS_PCM_AUDIO),
121 _payloadSizeBytes(MAX_INCOMING_PAYLOAD) {
122}
123
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000124void Receiver::Setup(AudioCodingModule *acm, RTPStream *rtpStream,
Peter Kasting69558702016-01-12 16:26:35 -0800125 std::string out_file_name, size_t channels) {
henrike@webrtc.org6ac22e62014-08-11 21:06:30 +0000126 struct CodecInst recvCodec = CodecInst();
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000127 int noOfCodecs;
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000128 EXPECT_EQ(0, acm->InitializeReceiver());
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000129
130 noOfCodecs = acm->NumberOfCodecs();
131 for (int i = 0; i < noOfCodecs; i++) {
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000132 EXPECT_EQ(0, acm->Codec(i, &recvCodec));
133 if (recvCodec.channels == channels)
kwibergda2bf4e2016-10-24 13:47:09 -0700134 EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype,
135 CodecInstToSdp(recvCodec)));
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000136 // Forces mono/stereo for Opus.
137 if (!strcmp(recvCodec.plname, "opus")) {
138 recvCodec.channels = channels;
kwibergda2bf4e2016-10-24 13:47:09 -0700139 EXPECT_EQ(true, acm->RegisterReceiveCodec(recvCodec.pltype,
140 CodecInstToSdp(recvCodec)));
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000141 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000142 }
phoglund@webrtc.orgd1a860b2012-01-26 14:49:28 +0000143
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000144 int playSampFreq;
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000145 std::string file_name;
146 std::stringstream file_stream;
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000147 file_stream << webrtc::test::OutputPath() << out_file_name
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000148 << static_cast<int>(codeId) << ".pcm";
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000149 file_name = file_stream.str();
150 _rtpStream = rtpStream;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000151
152 if (testMode == 1) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000153 playSampFreq = recvCodec.plfreq;
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000154 _pcmFile.Open(file_name, recvCodec.plfreq, "wb+");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000155 } else if (testMode == 0) {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000156 playSampFreq = 32000;
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000157 _pcmFile.Open(file_name, 32000, "wb+");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000158 } else {
159 printf("\nValid output frequencies:\n");
160 printf("8000\n16000\n32000\n-1,");
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000161 printf("which means output frequency equal to received signal frequency");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000162 printf("\n\nChoose output sampling frequency: ");
163 ASSERT_GT(scanf("%d", &playSampFreq), 0);
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000164 file_name = webrtc::test::OutputPath() + out_file_name + ".pcm";
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +0000165 _pcmFile.Open(file_name, playSampFreq, "wb+");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000166 }
phoglund@webrtc.orgd1a860b2012-01-26 14:49:28 +0000167
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000168 _realPayloadSizeBytes = 0;
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000169 _playoutBuffer = new int16_t[WEBRTC_10MS_PCM_AUDIO];
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000170 _frequency = playSampFreq;
171 _acm = acm;
172 _firstTime = true;
173}
174
175void Receiver::Teardown() {
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000176 delete[] _playoutBuffer;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000177 _pcmFile.Close();
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000178}
179
180bool Receiver::IncomingPacket() {
181 if (!_rtpStream->EndOfFile()) {
182 if (_firstTime) {
183 _firstTime = false;
184 _realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
185 _payloadSizeBytes, &_nextTime);
andrew@webrtc.org975e4a32012-01-17 19:27:33 +0000186 if (_realPayloadSizeBytes == 0) {
187 if (_rtpStream->EndOfFile()) {
188 _firstTime = true;
189 return true;
190 } else {
andrew@webrtc.org975e4a32012-01-17 19:27:33 +0000191 return false;
192 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000193 }
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000194 }
niklase@google.com470e71d2011-07-07 08:21:25 +0000195
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000196 EXPECT_EQ(0, _acm->IncomingPacket(_incomingPayload, _realPayloadSizeBytes,
197 _rtpInfo));
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000198 _realPayloadSizeBytes = _rtpStream->Read(&_rtpInfo, _incomingPayload,
199 _payloadSizeBytes, &_nextTime);
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000200 if (_realPayloadSizeBytes == 0 && _rtpStream->EndOfFile()) {
201 _firstTime = true;
niklase@google.com470e71d2011-07-07 08:21:25 +0000202 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000203 }
204 return true;
niklase@google.com470e71d2011-07-07 08:21:25 +0000205}
206
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000207bool Receiver::PlayoutData() {
208 AudioFrame audioFrame;
henrik.lundind4ccb002016-05-17 12:21:55 -0700209 bool muted;
210 int32_t ok = _acm->PlayoutData10Ms(_frequency, &audioFrame, &muted);
211 if (muted) {
212 ADD_FAILURE();
213 return false;
214 }
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000215 EXPECT_EQ(0, ok);
216 if (ok < 0){
217 return false;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000218 }
219 if (_playoutLengthSmpls == 0) {
220 return false;
221 }
yujo36b1a5f2017-06-12 12:45:32 -0700222 _pcmFile.Write10MsData(audioFrame.data(),
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000223 audioFrame.samples_per_channel_ * audioFrame.num_channels_);
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000224 return true;
225}
226
227void Receiver::Run() {
pbos@webrtc.org0946a562013-04-09 00:28:06 +0000228 uint8_t counter500Ms = 50;
229 uint32_t clock = 0;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000230
231 while (counter500Ms > 0) {
232 if (clock == 0 || clock >= _nextTime) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000233 EXPECT_TRUE(IncomingPacket());
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000234 if (clock == 0) {
235 clock = _nextTime;
236 }
237 }
238 if ((clock % 10) == 0) {
239 if (!PlayoutData()) {
240 clock++;
241 continue;
242 }
243 }
244 if (_rtpStream->EndOfFile()) {
245 counter500Ms--;
246 }
247 clock++;
248 }
249}
250
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +0000251EncodeDecodeTest::EncodeDecodeTest() {
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000252 _testMode = 2;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000253}
254
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +0000255EncodeDecodeTest::EncodeDecodeTest(int testMode) {
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000256 //testMode == 0 for autotest
257 //testMode == 1 for testing all codecs/parameters
258 //testMode > 1 for specific user-input test (as it was used before)
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000259 _testMode = testMode;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000260}
261
262void EncodeDecodeTest::Perform() {
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000263 int numCodecs = 1;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000264 int codePars[3]; // Frequency, packet size, rate.
265 int numPars[52]; // Number of codec parameters sets (freq, pacsize, rate)
266 // to test, for a given codec.
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000267
268 codePars[0] = 0;
269 codePars[1] = 0;
270 codePars[2] = 0;
271
solenbergc7b4a452017-09-28 07:37:11 -0700272 std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create());
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000273 struct CodecInst sendCodecTmp;
tina.legrand@webrtc.org5b4f36d2012-06-01 14:51:28 +0000274 numCodecs = acm->NumberOfCodecs();
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000275
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000276 if (_testMode != 2) {
277 for (int n = 0; n < numCodecs; n++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000278 EXPECT_EQ(0, acm->Codec(n, &sendCodecTmp));
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000279 if (STR_CASE_CMP(sendCodecTmp.plname, "telephone-event") == 0) {
280 numPars[n] = 0;
281 } else if (STR_CASE_CMP(sendCodecTmp.plname, "cn") == 0) {
282 numPars[n] = 0;
283 } else if (STR_CASE_CMP(sendCodecTmp.plname, "red") == 0) {
284 numPars[n] = 0;
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000285 } else if (sendCodecTmp.channels == 2) {
286 numPars[n] = 0;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000287 } else {
288 numPars[n] = 1;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000289 }
290 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000291 } else {
292 numCodecs = 1;
293 numPars[0] = 1;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000294 }
295
296 _receiver.testMode = _testMode;
297
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000298 // Loop over all mono codecs:
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000299 for (int codeId = 0; codeId < numCodecs; codeId++) {
tina.legrand@webrtc.org45175852012-06-01 09:27:35 +0000300 // Only encode using real mono encoders, not telephone-event and cng.
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000301 for (int loopPars = 1; loopPars <= numPars[codeId]; loopPars++) {
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000302 // Encode all data to file.
pbos@webrtc.orgc86e45d2014-10-01 10:05:40 +0000303 std::string fileName = EncodeToFile(1, codeId, codePars, _testMode);
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000304
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000305 RTPFile rtpFile;
kjellander@webrtc.org5490c712011-12-21 13:34:18 +0000306 rtpFile.Open(fileName.c_str(), "rb");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000307
308 _receiver.codeId = codeId;
309
310 rtpFile.ReadHeader();
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000311 _receiver.Setup(acm.get(), &rtpFile, "encodeDecode_out", 1);
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000312 _receiver.Run();
313 _receiver.Teardown();
314 rtpFile.Close();
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000315 }
316 }
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000317}
318
pbos@webrtc.orgc86e45d2014-10-01 10:05:40 +0000319std::string EncodeDecodeTest::EncodeToFile(int fileType,
320 int codeId,
321 int* codePars,
322 int testMode) {
solenbergc7b4a452017-09-28 07:37:11 -0700323 std::unique_ptr<AudioCodingModule> acm(AudioCodingModule::Create());
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000324 RTPFile rtpFile;
pbos@webrtc.orgc86e45d2014-10-01 10:05:40 +0000325 std::string fileName = webrtc::test::TempFilename(webrtc::test::OutputPath(),
326 "encode_decode_rtp");
kjellander@webrtc.org5490c712011-12-21 13:34:18 +0000327 rtpFile.Open(fileName.c_str(), "wb+");
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000328 rtpFile.WriteHeader();
329
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +0000330 // Store for auto_test and logging.
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000331 _sender.testMode = testMode;
332 _sender.codeId = codeId;
333
minyue@webrtc.orgaa5ea1c2014-05-23 15:16:51 +0000334 _sender.Setup(acm.get(), &rtpFile, "audio_coding/testfile32kHz", 32000, 1);
kwiberg1fd4a4a2015-11-03 11:20:50 -0800335 if (acm->SendCodec()) {
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000336 _sender.Run();
337 }
338 _sender.Teardown();
339 rtpFile.Close();
pbos@webrtc.orgc86e45d2014-10-01 10:05:40 +0000340
341 return fileName;
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000342}
343
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +0000344} // namespace webrtc