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_DSP_SHOE_BOX_ROOM_H_ |
18 | #define RESONANCE_AUDIO_DSP_SHOE_BOX_ROOM_H_ |
19 | |
20 | #include <vector> |
21 | |
22 | #include "base/misc_math.h" |
23 | #include "dsp/reflection.h" |
24 | |
25 | namespace vraudio { |
26 | |
27 | // Computes a set of reflections from each surface of a shoe-box room model. |
28 | // Uses a simplified calculation method which assumes that all the sources are |
29 | // 'attached' to the listener. Also, assumes that the listener is inside the |
30 | // shoe-box room. |
31 | // |
32 | // @param relative_listener_position Relative listener position to the center of |
33 | // the room. |
34 | // @param room_dimensions Dimensions of the room. |
35 | // @param reflection_coefficients Reflection coefficients. |
36 | // @return List of computed reflections by the image source method. |
37 | void ComputeReflections(const WorldPosition& relative_listener_position, |
38 | const WorldPosition& room_dimensions, |
39 | const float* reflection_coefficients, |
40 | std::vector<Reflection>* reflections); |
41 | |
42 | } // namespace vraudio |
43 | |
44 | #endif // RESONANCE_AUDIO_DSP_SHOE_BOX_ROOM_H_ |
45 | |