OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <stddef.h> |
5 #include <stdint.h> | 6 #include <stdint.h> |
6 | 7 |
7 #include <algorithm> | 8 #include <algorithm> |
8 #include <cstdio> | 9 #include <cstdio> |
9 #include <cstdlib> | 10 #include <cstdlib> |
10 #include <limits> | 11 #include <limits> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "media/cast/test/utility/audio_utility.h" | 15 #include "media/cast/test/utility/audio_utility.h" |
(...skipping 16 matching lines...) Expand all Loading... |
31 for (size_t i = 0; i < samples.size(); ++i) { | 32 for (size_t i = 0; i < samples.size(); ++i) { |
32 const int16_t sample_s16 = static_cast<int16_t>( | 33 const int16_t sample_s16 = static_cast<int16_t>( |
33 samples[i] * std::numeric_limits<int16_t>::max()); | 34 samples[i] * std::numeric_limits<int16_t>::max()); |
34 putchar(sample_s16 & 0xff); | 35 putchar(sample_s16 & 0xff); |
35 putchar(sample_s16 >> 8); | 36 putchar(sample_s16 >> 8); |
36 putchar(sample_s16 & 0xff); | 37 putchar(sample_s16 & 0xff); |
37 putchar(sample_s16 >> 8); | 38 putchar(sample_s16 >> 8); |
38 } | 39 } |
39 } | 40 } |
40 } | 41 } |
OLD | NEW |