OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This application is a test for AudioRendererAlgorithmOLA. It reads in a | 5 // This application is a test for AudioRendererAlgorithmOLA. It reads in a |
6 // specified wav file (so far only 8, 16 and 32 bit are supported) and uses | 6 // specified wav file (so far only 8, 16 and 32 bit are supported) and uses |
7 // ARAO to scale the playback by a specified rate. Then it outputs the result | 7 // ARAO to scale the playback by a specified rate. Then it outputs the result |
8 // to the specified location. Command line calls should be as follows: | 8 // to the specified location. Command line calls should be as follows: |
9 // | 9 // |
10 // wav_ola_test RATE INFILE OUTFILE | 10 // wav_ola_test RATE INFILE OUTFILE |
11 | 11 |
12 #include <iostream> | 12 #include <ostream> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
17 #include "base/file_util.h" | 17 #include "base/file_util.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
22 #include "media/base/data_buffer.h" | 22 #include "media/base/data_buffer.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 wav.subchunk1_size = 16; | 166 wav.subchunk1_size = 16; |
167 wav.subchunk2_size = bytes_written; | 167 wav.subchunk2_size = bytes_written; |
168 fseek(output.get(), 0, SEEK_SET); | 168 fseek(output.get(), 0, SEEK_SET); |
169 if (fwrite(&wav, sizeof(wav), 1, output.get()) < 1) { | 169 if (fwrite(&wav, sizeof(wav), 1, output.get()) < 1) { |
170 LOG(ERROR) << "could not write wav header."; | 170 LOG(ERROR) << "could not write wav header."; |
171 return 1; | 171 return 1; |
172 } | 172 } |
173 CommandLine::Reset(); | 173 CommandLine::Reset(); |
174 return 0; | 174 return 0; |
175 } | 175 } |
OLD | NEW |