Audaspace
1.9.0
A high level audio library.
Toggle main menu visibility
Loading...
Searching...
No Matches
fx
HRTF.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright 2015-2016 Juan Francisco Crespo Galán
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
#pragma once
18
24
25
#include "
util/StreamBuffer.h
"
26
#include "
util/FFTPlan.h
"
27
#include "
ImpulseResponse.h
"
28
29
#include <memory>
30
#include <vector>
31
#include <unordered_map>
32
#include <utility>
33
34
AUD_NAMESPACE_BEGIN
35
39
class
AUD_API
HRTF
40
{
41
private
:
45
std::unordered_map<float, std::unordered_map<float, std::shared_ptr<ImpulseResponse>>> m_hrtfs;
46
50
std::shared_ptr<FFTPlan> m_plan;
51
55
Specs
m_specs;
56
60
bool
m_empty;
61
62
// delete copy constructor and operator=
63
HRTF(
const
HRTF&) =
delete
;
64
HRTF& operator=(
const
HRTF&) =
delete
;
65
66
public
:
70
HRTF
();
71
76
HRTF
(std::shared_ptr<FFTPlan> plan);
77
85
bool
addImpulseResponse
(std::shared_ptr<StreamBuffer> impulseResponse,
float
azimuth,
float
elevation);
86
93
std::pair<std::shared_ptr<ImpulseResponse>, std::shared_ptr<ImpulseResponse>>
getImpulseResponse
(
float
&azimuth,
float
&elevation);
94
99
Specs
getSpecs
();
100
105
bool
isEmpty
();
106
};
107
108
AUD_NAMESPACE_END
AUD_NAMESPACE_END
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition
Audaspace.h:119
AUD_NAMESPACE_BEGIN
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition
Audaspace.h:116
AUD_API
#define AUD_API
Used for exporting symbols in the shared library.
Definition
Audaspace.h:93
FFTPlan.h
The FFTPlan class.
ImpulseResponse.h
The ImpulseResponse class.
StreamBuffer.h
The StreamBuffer class.
HRTF::isEmpty
bool isEmpty()
Retrieves the state of the HRTF object.
HRTF::addImpulseResponse
bool addImpulseResponse(std::shared_ptr< StreamBuffer > impulseResponse, float azimuth, float elevation)
Adds a new HRTF to the class.
HRTF::HRTF
HRTF()
Creates a new empty HRTF object that will instance it own FFTPlan with default size.
HRTF::getSpecs
Specs getSpecs()
Retrieves the specs shared by all the HRTFs.
HRTF::HRTF
HRTF(std::shared_ptr< FFTPlan > plan)
Creates a new empty HRTF object.
HRTF::getImpulseResponse
std::pair< std::shared_ptr< ImpulseResponse >, std::shared_ptr< ImpulseResponse > > getImpulseResponse(float &azimuth, float &elevation)
Retrieves a pair of HRTFs for a certain azimuth and elevation.
Specs
Specification of a sound source.
Definition
Specification.h:119
Generated by
1.17.0