You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  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. #ifndef API_TEST_AUDIOPROC_FLOAT_H_
  11. #define API_TEST_AUDIOPROC_FLOAT_H_
  12. #include <memory>
  13. #include <vector>
  14. #include "modules/audio_processing/include/audio_processing.h"
  15. namespace webrtc {
  16. namespace test {
  17. // This is an interface for the audio processing simulation utility. This
  18. // utility can be used to simulate the audioprocessing module using a recording
  19. // (either an AEC dump or wav files), and generate the output as a wav file.
  20. // The |ap_builder| object will be used to create the AudioProcessing instance
  21. // that is used during the simulation. The |ap_builder| supports setting of
  22. // injectable components, which will be passed on to the created AudioProcessing
  23. // instance. It is needed to pass the command line flags as |argc| and |argv|,
  24. // so these can be interpreted properly by the utility.
  25. // To get a fully-working audioproc_f utility, all that is needed is to write a
  26. // main function, create an AudioProcessingBuilder, optionally set custom
  27. // processing components on it, and pass the builder together with the command
  28. // line arguments into this function.
  29. // To see a list of all supported command line flags, run the executable with
  30. // the '--help' flag.
  31. int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
  32. int argc,
  33. char* argv[]);
  34. // Interface for the audio processing simulation utility, which is similar to
  35. // the one above, but which adds the option of receiving the input as a string
  36. // and returning the output as an array. The first three arguments fulfill the
  37. // same purpose as above. Pass the |input_aecdump| to provide the content of an
  38. // AEC dump file as a string. After the simulation is completed,
  39. // |processed_capture_samples| will contain the the samples processed on the
  40. // capture side.
  41. int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
  42. int argc,
  43. char* argv[],
  44. absl::string_view input_aecdump,
  45. std::vector<float>* processed_capture_samples);
  46. } // namespace test
  47. } // namespace webrtc
  48. #endif // API_TEST_AUDIOPROC_FLOAT_H_