• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 3-Clause Clear License
5  * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear
6  * License was not distributed with this source code in the LICENSE file, you
7  * can obtain it at www.aomedia.org/license/software-license/bsd-3-c-c. If the
8  * Alliance for Open Media Patent License 1.0 was not distributed with this
9  * source code in the PATENTS file, you can obtain it at
10  * www.aomedia.org/license/patent.
11  */
12 
13 #include <cstddef>
14 #include <string>
15 #include <vector>
16 
17 #include "absl/status/status.h"
18 #include "iamf/cli/adm_to_user_metadata/adm/adm_elements.h"
19 #include "iamf/cli/wav_writer.h"
20 
21 namespace iamf_tools {
22 namespace adm_to_user_metadata {
23 
24 constexpr int kOutputWavChannels = 16;
25 
26 /*!\brief Invokes panner to convert audio objects to 3rd order ambisonics.
27  *
28  * \param input_filename Input wav file to panner.
29  * \param input_adm Input ADM struct to panner.
30  * \param block_indices Vector holding the index of audioBlockFormat(s)
31  *        which contain the positional metadata for each channel.
32  * \param wav_writer WavWriter used for writing into the output file.
33  * \return `absl::OkStatus()` on success. A specific error code on failure.
34  */
35 absl::Status PanObjectsToAmbisonics(const std::string& input_filename,
36                                     const ADM& input_adm,
37                                     const std::vector<size_t>& block_indices,
38                                     WavWriter& wav_writer);
39 
40 }  // namespace adm_to_user_metadata
41 }  // namespace iamf_tools
42