| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADE
R_H_ |
| 13 | 13 |
| 14 #include <cstddef> | 14 #include <cstddef> |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "webrtc/base/array_view.h" |
| 17 #include "webrtc/modules/audio_processing/test/conversational_speech/wavreader_i
nterface.h" | 18 #include "webrtc/modules/audio_processing/test/conversational_speech/wavreader_i
nterface.h" |
| 18 #include "webrtc/test/gmock.h" | 19 #include "webrtc/test/gmock.h" |
| 19 #include "webrtc/typedefs.h" | 20 #include "webrtc/typedefs.h" |
| 20 | 21 |
| 21 namespace webrtc { | 22 namespace webrtc { |
| 22 namespace test { | 23 namespace test { |
| 23 namespace conversational_speech { | 24 namespace conversational_speech { |
| 24 | 25 |
| 25 class MockWavReader : public WavReaderInterface { | 26 class MockWavReader : public WavReaderInterface { |
| 26 public: | 27 public: |
| 27 MockWavReader(int sample_rate, size_t num_channels, size_t num_samples); | 28 MockWavReader(int sample_rate, size_t num_channels, size_t num_samples); |
| 28 ~MockWavReader(); | 29 ~MockWavReader(); |
| 29 | 30 |
| 30 // TODO(alessiob): use ON_CALL to return random samples. | 31 // TODO(alessiob): use ON_CALL to return random samples. |
| 31 MOCK_METHOD2(ReadFloatSamples, size_t(size_t, float*)); | 32 MOCK_METHOD1(ReadFloatSamples, size_t(rtc::ArrayView<float>)); |
| 32 MOCK_METHOD2(ReadInt16Samples, size_t(size_t, int16_t*)); | 33 MOCK_METHOD1(ReadInt16Samples, size_t(rtc::ArrayView<int16_t>)); |
| 33 | 34 |
| 34 MOCK_CONST_METHOD0(sample_rate, int()); | 35 MOCK_CONST_METHOD0(SampleRate, int()); |
| 35 MOCK_CONST_METHOD0(num_channels, size_t()); | 36 MOCK_CONST_METHOD0(NumChannels, size_t()); |
| 36 MOCK_CONST_METHOD0(num_samples, size_t()); | 37 MOCK_CONST_METHOD0(NumSamples, size_t()); |
| 37 | 38 |
| 38 private: | 39 private: |
| 39 const int sample_rate_; | 40 const int sample_rate_; |
| 40 const size_t num_channels_; | 41 const size_t num_channels_; |
| 41 const size_t num_samples_; | 42 const size_t num_samples_; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace conversational_speech | 45 } // namespace conversational_speech |
| 45 } // namespace test | 46 } // namespace test |
| 46 } // namespace webrtc | 47 } // namespace webrtc |
| 47 | 48 |
| 48 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVRE
ADER_H_ | 49 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVRE
ADER_H_ |
| OLD | NEW |