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