blob: 0ea278cf89a4c42e342b14b0c6428960214c21e6 [file] [log] [blame]
peah60a189f2016-05-25 03:54:401/*
2 * Copyright (c) 2016 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
Mirko Bonadei92ea95e2017-09-15 04:47:3111#ifndef MODULES_AUDIO_PROCESSING_TEST_WAV_BASED_SIMULATOR_H_
12#define MODULES_AUDIO_PROCESSING_TEST_WAV_BASED_SIMULATOR_H_
peah60a189f2016-05-25 03:54:4013
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 04:47:3116#include "modules/audio_processing/test/audio_processing_simulator.h"
peah60a189f2016-05-25 03:54:4017
Mirko Bonadei92ea95e2017-09-15 04:47:3118#include "rtc_base/constructormagic.h"
peah60a189f2016-05-25 03:54:4019
20namespace webrtc {
21namespace test {
22
23// Used to perform an audio processing simulation from wav files.
24class WavBasedSimulator final : public AudioProcessingSimulator {
25 public:
kwiberg3cc87742016-08-29 22:10:3426 explicit WavBasedSimulator(const SimulationSettings& settings);
27 ~WavBasedSimulator() override;
peah60a189f2016-05-25 03:54:4028
29 // Processes the WAV input.
30 void Process() override;
31
32 private:
33 enum SimulationEventType {
34 kProcessStream,
35 kProcessReverseStream,
36 };
37
38 void Initialize();
39 bool HandleProcessStreamCall();
40 bool HandleProcessReverseStreamCall();
41 void PrepareProcessStreamCall();
42 void PrepareReverseProcessStreamCall();
peah5ad5de32016-12-09 11:18:2243 static std::vector<SimulationEventType> GetDefaultEventChain();
44 static std::vector<SimulationEventType> GetCustomEventChain(
45 const std::string& filename);
peah60a189f2016-05-25 03:54:4046
47 std::vector<SimulationEventType> call_chain_;
48 int last_specified_microphone_level_ = 100;
49
50 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WavBasedSimulator);
51};
52
53} // namespace test
54} // namespace webrtc
55
Mirko Bonadei92ea95e2017-09-15 04:47:3156#endif // MODULES_AUDIO_PROCESSING_TEST_WAV_BASED_SIMULATOR_H_