1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADER_H_ 12 #define MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADER_H_ 13 14 #include <cstddef> 15 #include <string> 16 17 #include "api/array_view.h" 18 #include "modules/audio_processing/test/conversational_speech/wavreader_interface.h" 19 #include "test/gmock.h" 20 21 namespace webrtc { 22 namespace test { 23 namespace conversational_speech { 24 25 class MockWavReader : public WavReaderInterface { 26 public: 27 MockWavReader(int sample_rate, size_t num_channels, size_t num_samples); 28 ~MockWavReader(); 29 30 // TODO(alessiob): use ON_CALL to return random samples if needed. 31 MOCK_METHOD(size_t, ReadFloatSamples, (rtc::ArrayView<float>), (override)); 32 MOCK_METHOD(size_t, ReadInt16Samples, (rtc::ArrayView<int16_t>), (override)); 33 34 MOCK_METHOD(int, SampleRate, (), (const, override)); 35 MOCK_METHOD(size_t, NumChannels, (), (const, override)); 36 MOCK_METHOD(size_t, NumSamples, (), (const, override)); 37 38 private: 39 const int sample_rate_; 40 const size_t num_channels_; 41 const size_t num_samples_; 42 }; 43 44 } // namespace conversational_speech 45 } // namespace test 46 } // namespace webrtc 47 48 #endif // MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADER_H_ 49