acm_remixing.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2019 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 MODULES_AUDIO_CODING_ACM2_ACM_REMIXING_H_
  11. #define MODULES_AUDIO_CODING_ACM2_ACM_REMIXING_H_
  12. #include <vector>
  13. #include "api/audio/audio_frame.h"
  14. namespace webrtc {
  15. // Stereo-to-mono downmixing. The length of the output must equal to the number
  16. // of samples per channel in the input.
  17. void DownMixFrame(const AudioFrame& input, rtc::ArrayView<int16_t> output);
  18. // Remixes the interleaved input frame to an interleaved output data vector. The
  19. // remixed data replaces the data in the output vector which is resized if
  20. // needed. The remixing supports any combination of input and output channels,
  21. // as well as any number of samples per channel.
  22. void ReMixFrame(const AudioFrame& input,
  23. size_t num_output_channels,
  24. std::vector<int16_t>* output);
  25. } // namespace webrtc
  26. #endif // MODULES_AUDIO_CODING_ACM2_ACM_REMIXING_H_