Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
ImpulseResponse.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
25#include "util/StreamBuffer.h"
26#include "util/FFTPlan.h"
27#include "IReader.h"
28
29#include <memory>
30#include <vector>
31
33
41{
42private:
48 std::vector<std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>>> m_processedIR;
49
53 Specs m_specs;
54
58 int m_length;
59
60 // delete copy constructor and operator=
61 ImpulseResponse(const ImpulseResponse&) = delete;
62 ImpulseResponse& operator=(const ImpulseResponse&) = delete;
63
64public:
71 ImpulseResponse(std::shared_ptr<StreamBuffer> impulseResponse, std::shared_ptr<FFTPlan> plan);
72
78 ImpulseResponse(std::shared_ptr<StreamBuffer> impulseResponse);
79
85
90 int getLength();
91
97 std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> getChannel(int n);
98
99private:
105 void processImpulseResponse(std::shared_ptr<IReader> reader, std::shared_ptr<FFTPlan> plan);
106};
107
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
The FFTPlan class.
The IReader interface.
The StreamBuffer class.
This class represents an impulse response that can be used in convolution.
Definition ImpulseResponse.h:41
ImpulseResponse(std::shared_ptr< StreamBuffer > impulseResponse, std::shared_ptr< FFTPlan > plan)
Creates a new ImpulseResponse object.
ImpulseResponse(std::shared_ptr< StreamBuffer > impulseResponse)
Creates a new ImpulseResponse object.
int getLength()
Retrieves the length of the impulse response.
std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > getChannel(int n)
Retrieves one channel of the impulse response.
Specs getSpecs()
Returns the specification of the impulse response.
Specification of a sound source.
Definition Specification.h:119