Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 void WriteSamples(const int16_t* samples, size_t num_samples); | 37 void WriteSamples(const int16_t* samples, size_t num_samples); |
| 38 void WriteSamples(const float* samples, size_t num_samples); | 38 void WriteSamples(const float* samples, size_t num_samples); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 FILE* file_handle_; | 41 FILE* file_handle_; |
| 42 | 42 |
| 43 RTC_DISALLOW_COPY_AND_ASSIGN(RawFile); | 43 RTC_DISALLOW_COPY_AND_ASSIGN(RawFile); |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 // Writes ChannelBuffers to a provided WavWriter. | |
| 47 class ChannelBufferWavWriter final { | |
| 48 public: | |
| 49 explicit ChannelBufferWavWriter(rtc::scoped_ptr<WavWriter> file); | |
|
aluebs-webrtc
2015/10/24 00:53:35
Why does this needs to be passed in? Can't we just
aluebs-webrtc
2015/10/29 01:03:20
Missed this comment? I have the same question rega
Andrew MacDonald
2015/10/29 01:14:33
I'm currently using this in a very specific contex
aluebs-webrtc
2015/10/30 01:26:59
Sounds reasonable. Agreed.
| |
| 50 void Write(const ChannelBuffer<float>& buffer); | |
| 51 | |
| 52 private: | |
| 53 rtc::scoped_ptr<WavWriter> file_; | |
| 54 std::vector<float> interleaved_; | |
| 55 | |
| 56 RTC_DISALLOW_COPY_AND_ASSIGN(ChannelBufferWavWriter); | |
| 57 }; | |
| 58 | |
| 46 void WriteIntData(const int16_t* data, | 59 void WriteIntData(const int16_t* data, |
| 47 size_t length, | 60 size_t length, |
| 48 WavWriter* wav_file, | 61 WavWriter* wav_file, |
| 49 RawFile* raw_file); | 62 RawFile* raw_file); |
| 50 | 63 |
| 51 void WriteFloatData(const float* const* data, | 64 void WriteFloatData(const float* const* data, |
| 52 int samples_per_channel, | 65 int samples_per_channel, |
| 53 int num_channels, | 66 int num_channels, |
| 54 WavWriter* wav_file, | 67 WavWriter* wav_file, |
| 55 RawFile* raw_file); | 68 RawFile* raw_file); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 return values; | 124 return values; |
| 112 } | 125 } |
| 113 | 126 |
| 114 // Parses the array geometry from the command line. | 127 // Parses the array geometry from the command line. |
| 115 // | 128 // |
| 116 // If a vector with size != num_mics is returned, an error has occurred and an | 129 // If a vector with size != num_mics is returned, an error has occurred and an |
| 117 // appropriate error message has been printed to stdout. | 130 // appropriate error message has been printed to stdout. |
| 118 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions, | 131 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions, |
| 119 size_t num_mics); | 132 size_t num_mics); |
| 120 | 133 |
| 134 // Same as above, but without the num_mics check for when it isn't available. | |
| 135 std::vector<Point> ParseArrayGeometry(const std::string& mic_positions); | |
| 136 | |
| 121 } // namespace webrtc | 137 } // namespace webrtc |
| 122 | 138 |
| 123 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_TEST_UTILS_H_ | 139 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_TEST_UTILS_H_ |
| OLD | NEW |