audioproc_float.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. // Any audio_processing object specified in the input is used for the
  21. // simulation. The optional |audio_processing| object provides the
  22. // AudioProcessing instance that is used during the simulation. Note that when
  23. // the audio_processing object is specified all functionality that relies on
  24. // using the AudioProcessingBuilder is deactivated, since the AudioProcessing
  25. // object is already created and the builder is not used in the simulation. It
  26. // is needed to pass the command line flags as |argc| and |argv|, so these can
  27. // be interpreted properly by the utility. To see a list of all supported
  28. // command line flags, run the executable with the '--help' flag.
  29. int AudioprocFloat(rtc::scoped_refptr<AudioProcessing> audio_processing,
  30. int argc,
  31. char* argv[]);
  32. // This is an interface for the audio processing simulation utility. This
  33. // utility can be used to simulate the audioprocessing module using a recording
  34. // (either an AEC dump or wav files), and generate the output as a wav file.
  35. // The |ap_builder| object will be used to create the AudioProcessing instance
  36. // that is used during the simulation. The |ap_builder| supports setting of
  37. // injectable components, which will be passed on to the created AudioProcessing
  38. // instance. It is needed to pass the command line flags as |argc| and |argv|,
  39. // so these can be interpreted properly by the utility.
  40. // To get a fully-working audioproc_f utility, all that is needed is to write a
  41. // main function, create an AudioProcessingBuilder, optionally set custom
  42. // processing components on it, and pass the builder together with the command
  43. // line arguments into this function.
  44. // To see a list of all supported command line flags, run the executable with
  45. // the '--help' flag.
  46. int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
  47. int argc,
  48. char* argv[]);
  49. // Interface for the audio processing simulation utility, which is similar to
  50. // the one above, but which adds the option of receiving the input as a string
  51. // and returning the output as an array. The first three arguments fulfill the
  52. // same purpose as above. Pass the |input_aecdump| to provide the content of an
  53. // AEC dump file as a string. After the simulation is completed,
  54. // |processed_capture_samples| will contain the the samples processed on the
  55. // capture side.
  56. int AudioprocFloat(std::unique_ptr<AudioProcessingBuilder> ap_builder,
  57. int argc,
  58. char* argv[],
  59. absl::string_view input_aecdump,
  60. std::vector<float>* processed_capture_samples);
  61. } // namespace test
  62. } // namespace webrtc
  63. #endif // API_TEST_AUDIOPROC_FLOAT_H_