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