blob: 77e62849691c6cac9233f24a27ce44a1f796650d [file] [log] [blame]
Sam Zackrisson4d364492018-03-02 16:03:21 +01001/*
2 * Copyright (c) 2018 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_INCLUDE_AUDIO_GENERATOR_H_
12#define MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_GENERATOR_H_
13
14#include "modules/audio_processing/include/audio_frame_view.h"
15
16namespace webrtc {
17// This class is used as input sink for the APM, for diagnostic purposes.
18// Generates an infinite audio signal, [-1, 1] floating point values, in frames
19// of fixed channel count and sample rate.
20class AudioGenerator {
21 public:
22 virtual ~AudioGenerator() {}
23
24 // Fill |audio| with the next samples of the audio signal.
25 virtual void FillFrame(AudioFrameView<float> audio) = 0;
26
27 // Return the number of channels output by the AudioGenerator.
28 virtual size_t NumChannels() = 0;
29
30 // Return the sample rate output by the AudioGenerator.
31 virtual size_t SampleRateHz() = 0;
32};
33
34} // namespace webrtc
35
36#endif // MODULES_AUDIO_PROCESSING_INCLUDE_AUDIO_GENERATOR_H_