Audaspace
1.9.0
A high level audio library.
Toggle main menu visibility
Loading...
Searching...
No Matches
fx
Equalizer.h
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright 2022 Marcos Perez Gonzalez
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 <memory>
26
#include <vector>
27
28
#include "
ISound.h
"
29
#include "
ImpulseResponse.h
"
30
31
AUD_NAMESPACE_BEGIN
32
33
class
Buffer
;
34
class
ImpulseResponse
;
38
class
AUD_API
Equalizer :
public
ISound
39
{
40
private
:
44
std::shared_ptr<ISound> m_sound;
45
49
std::shared_ptr<Buffer> m_bufEQ;
50
54
std::shared_ptr<ImpulseResponse> m_impulseResponse;
55
59
Equalizer(
const
Equalizer&) =
delete
;
60
Equalizer& operator=(
const
Equalizer&) =
delete
;
61
66
std::shared_ptr<ImpulseResponse> createImpulseResponse();
67
72
std::shared_ptr<Buffer> minimumPhaseFilterHomomorphic(std::shared_ptr<Buffer> original,
int
lOriginal,
int
lWork);
73
78
std::shared_ptr<Buffer> minimumPhaseFilterHilbert(std::shared_ptr<Buffer> original,
int
lOriginal,
int
lWork);
79
80
public
:
85
Equalizer
(std::shared_ptr<ISound> sound, std::shared_ptr<Buffer> bufEQ,
int
externalSizeEq,
float
maxFreqEq,
int
sizeConversion);
86
87
virtual
~Equalizer();
88
virtual
std::shared_ptr<IReader>
createReader
();
89
90
/*
91
* Length of the external equalizer definition. It must be the number of "float" positions of the Buffer
92
*/
93
int
external_size_eq;
94
95
/*
96
* Length of the internal equalizer definition
97
*/
98
int
filter_length;
99
100
/*
101
* Maximum frequency used in the equalizer definition
102
*/
103
float
maxFreqEq;
104
};
105
106
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
ISound.h
The ISound interface.
ImpulseResponse.h
The ImpulseResponse class.
Buffer
This class is a simple buffer in RAM which is 32 Byte aligned and provides resize functionality.
Definition
Buffer.h:34
Equalizer::Equalizer
Equalizer(std::shared_ptr< ISound > sound, std::shared_ptr< Buffer > bufEQ, int externalSizeEq, float maxFreqEq, int sizeConversion)
Creates a new Equalizer.
Equalizer::createReader
virtual std::shared_ptr< IReader > createReader()
Creates a reader for playback of the sound source.
ISound
This class represents a type of sound source and saves the necessary values for it.
Definition
ISound.h:40
ImpulseResponse
This class represents an impulse response that can be used in convolution.
Definition
ImpulseResponse.h:41
Generated by
1.17.0