Audaspace 1.5.0
A high level audio library.
|
This class represents an impulse response that can be used in convolution. More...
#include <ImpulseResponse.h>
Public Member Functions | |
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. | |
Specs | getSpecs () |
Returns the specification of the impulse response. | |
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. | |
This class represents an impulse response that can be used in convolution.
When this class is instanced, the impulse response is divided in channels and those channels are divided in parts of N/2 samples (N being the size of the FFT plan used). The main objetive of this class is to allow the reutilization of an impulse response in various sounds without having to process it more than one time.
ImpulseResponse::ImpulseResponse | ( | std::shared_ptr< StreamBuffer > | impulseResponse, |
std::shared_ptr< FFTPlan > | plan ) |
Creates a new ImpulseResponse object.
The impulse response will be split and transformed to the frequency domain.
impulseResponse | The impulse response sound. |
plan | A shared pointer to a FFT plan used to transform the impulse response. |
ImpulseResponse::ImpulseResponse | ( | std::shared_ptr< StreamBuffer > | impulseResponse | ) |
Creates a new ImpulseResponse object.
This overload instances its own FFTPlan with default size. The impulse response will be split and transformed to the frequency domain.
impulseResponse | The impulse response sound. |
std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > ImpulseResponse::getChannel | ( | int | n | ) |
Retrieves one channel of the impulse response.
n | The desired channel number (from 0 to channels-1). |
int ImpulseResponse::getLength | ( | ) |
Retrieves the length of the impulse response.
Specs ImpulseResponse::getSpecs | ( | ) |
Returns the specification of the impulse response.