RavEngine
Loading...
Searching...
No Matches
ambisonic_codec.h
1
/*
2
Copyright 2018 Google Inc. All Rights Reserved.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS-IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16
17
#ifndef RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_
18
#define RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_
19
20
#include <vector>
21
22
#include "base/audio_buffer.h"
23
#include "base/spherical_angle.h"
24
25
namespace
vraudio {
26
// An encoder/decoder for ambisonic sound fields. It supports variable ambisonic
27
// order, ACN channel sequencing and SN3D normalization.
28
class
AmbisonicCodec
{
29
public
:
30
virtual
~AmbisonicCodec
() {}
31
// Encodes the given buffer of decoded vectors (unencoded data).
32
//
33
// @param input |AudioBuffer| of decoded (unencoded) data.
34
// @param output |AudioBuffer| to store the encoded data.
35
virtual
void
EncodeBuffer(
const
AudioBuffer
& input,
AudioBuffer
* output) = 0;
36
37
// Decodes the given |AudioBuffer| of planar (non-interleaved) encoded data.
38
//
39
// @param input |AudioBuffer| of encoded data.
40
// @param output |AudioBuffer| to store the decoded data.
41
virtual
void
DecodeBuffer(
const
AudioBuffer
& input,
AudioBuffer
* output) = 0;
42
43
// Returns the maximum periphonic ambisonic order that this codec supports.
44
virtual
int
ambisonic_order()
const
= 0;
45
46
// Returns the number of angles for this codec.
47
virtual
size_t
num_angles()
const
= 0;
48
49
// Returns the maximum number of spherical harmonics computed by this codec.
50
virtual
size_t
num_spherical_harmonics()
const
= 0;
51
52
// Returns the spherical angles currently used to define the encoder/decoder
53
// matrices.
54
virtual
const
std::vector<SphericalAngle>& angles()
const
= 0;
55
56
// Sets the spherical angles used to build the encoder/decoder matrices.
57
virtual
void
set_angles(
const
std::vector<SphericalAngle>& angles) = 0;
58
};
59
60
}
// namespace vraudio
61
62
#endif
// RESONANCE_AUDIO_AMBISONICS_AMBISONIC_CODEC_H_
vraudio::AmbisonicCodec
Definition
ambisonic_codec.h:28
vraudio::AudioBuffer
Definition
audio_buffer.h:78
RavEngine
deps
resonance-audio
resonance_audio
ambisonics
ambisonic_codec.h
Generated by
1.9.8