mock_wavreader.h (1617B)
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 <cstdint> 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 MOCK_METHOD(size_t, ReadFloatSamples, (webrtc::ArrayView<float>), (override)); 31 MOCK_METHOD(size_t, 32 ReadInt16Samples, 33 (webrtc::ArrayView<int16_t>), 34 (override)); 35 36 MOCK_METHOD(int, SampleRate, (), (const, override)); 37 MOCK_METHOD(size_t, NumChannels, (), (const, override)); 38 MOCK_METHOD(size_t, NumSamples, (), (const, override)); 39 40 private: 41 const int sample_rate_; 42 const size_t num_channels_; 43 const size_t num_samples_; 44 }; 45 46 } // namespace conversational_speech 47 } // namespace test 48 } // namespace webrtc 49 50 #endif // MODULES_AUDIO_PROCESSING_TEST_CONVERSATIONAL_SPEECH_MOCK_WAVREADER_H_