| Index: webrtc/modules/audio_processing/test/test_utils.h
|
| diff --git a/webrtc/modules/audio_processing/test/test_utils.h b/webrtc/modules/audio_processing/test/test_utils.h
|
| index 75e42398109ecdfbd7a5f1f24d28cac34804c296..93a0138c1686d7009dd0b2d7cf166b84d8df0baa 100644
|
| --- a/webrtc/modules/audio_processing/test/test_utils.h
|
| +++ b/webrtc/modules/audio_processing/test/test_utils.h
|
| @@ -41,6 +41,35 @@
|
| FILE* file_handle_;
|
|
|
| RTC_DISALLOW_COPY_AND_ASSIGN(RawFile);
|
| +};
|
| +
|
| +// Reads ChannelBuffers from a provided WavReader.
|
| +class ChannelBufferWavReader final {
|
| + public:
|
| + explicit ChannelBufferWavReader(rtc::scoped_ptr<WavReader> file);
|
| +
|
| + // Reads data from the file according to the |buffer| format. Returns false if
|
| + // a full buffer can't be read from the file.
|
| + bool Read(ChannelBuffer<float>* buffer);
|
| +
|
| + private:
|
| + rtc::scoped_ptr<WavReader> file_;
|
| + std::vector<float> interleaved_;
|
| +
|
| + RTC_DISALLOW_COPY_AND_ASSIGN(ChannelBufferWavReader);
|
| +};
|
| +
|
| +// Writes ChannelBuffers to a provided WavWriter.
|
| +class ChannelBufferWavWriter final {
|
| + public:
|
| + explicit ChannelBufferWavWriter(rtc::scoped_ptr<WavWriter> file);
|
| + void Write(const ChannelBuffer<float>& buffer);
|
| +
|
| + private:
|
| + rtc::scoped_ptr<WavWriter> file_;
|
| + std::vector<float> interleaved_;
|
| +
|
| + RTC_DISALLOW_COPY_AND_ASSIGN(ChannelBufferWavWriter);
|
| };
|
|
|
| void WriteIntData(const int16_t* data,
|
| @@ -118,6 +147,9 @@
|
| std::vector<Point> ParseArrayGeometry(const std::string& mic_positions,
|
| size_t num_mics);
|
|
|
| +// Same as above, but without the num_mics check for when it isn't available.
|
| +std::vector<Point> ParseArrayGeometry(const std::string& mic_positions);
|
| +
|
| } // namespace webrtc
|
|
|
| #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_TEST_UTILS_H_
|
|
|