xref: /aosp_15_r20/external/webrtc/modules/audio_processing/test/conversational_speech/mock_wavreader.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 #include "modules/audio_processing/test/conversational_speech/mock_wavreader.h"
12 
13 namespace webrtc {
14 namespace test {
15 namespace conversational_speech {
16 
17 using ::testing::Return;
18 
MockWavReader(int sample_rate,size_t num_channels,size_t num_samples)19 MockWavReader::MockWavReader(int sample_rate,
20                              size_t num_channels,
21                              size_t num_samples)
22     : sample_rate_(sample_rate),
23       num_channels_(num_channels),
24       num_samples_(num_samples) {
25   ON_CALL(*this, SampleRate()).WillByDefault(Return(sample_rate_));
26   ON_CALL(*this, NumChannels()).WillByDefault(Return(num_channels_));
27   ON_CALL(*this, NumSamples()).WillByDefault(Return(num_samples_));
28 }
29 
30 MockWavReader::~MockWavReader() = default;
31 
32 }  // namespace conversational_speech
33 }  // namespace test
34 }  // namespace webrtc
35