This class represents a sound that can be modified depending on a given impulse response.
More...
#include <ConvolverSound.h>
This class represents a sound that can be modified depending on a given impulse response.
◆ ConvolverSound() [1/2]
ConvolverSound::ConvolverSound |
( |
std::shared_ptr< ISound > | sound, |
|
|
std::shared_ptr< ImpulseResponse > | impulseResponse, |
|
|
std::shared_ptr< ThreadPool > | threadPool, |
|
|
std::shared_ptr< FFTPlan > | plan ) |
Creates a new ConvolverSound.
- Parameters
-
sound | The sound that will be convolved. |
impulseResponse | The impulse response sound. |
threadPool | A shared pointer to a ThreadPool object with 1 or more threads. |
plan | A shared pointer to a FFTPlan object that will be used for convolution. |
- Warning
- The same FFTPlan object must be used to construct both this and the ImpulseResponse object provided.
◆ ConvolverSound() [2/2]
ConvolverSound::ConvolverSound |
( |
std::shared_ptr< ISound > | sound, |
|
|
std::shared_ptr< ImpulseResponse > | impulseResponse, |
|
|
std::shared_ptr< ThreadPool > | threadPool ) |
Creates a new ConvolverSound.
A default FFT plan will be created.
- Parameters
-
sound | The sound that will be convolved. |
impulseResponse | The impulse response sound. |
threadPool | A shared pointer to a ThreadPool object with 1 or more threads. |
- Warning
- To use this constructor no FFTPlan object must have been provided to the inpulseResponse.
◆ createReader()
virtual std::shared_ptr< IReader > ConvolverSound::createReader |
( |
| ) |
|
|
virtual |
Creates a reader for playback of the sound source.
- Returns
- A pointer to an IReader object or nullptr if there has been an error.
- Exceptions
-
Exception | An exception may be thrown if there has been a more unexpected error during reader creation. |
Implements ISound.
◆ getImpulseResponse()
Retrieves the impulse response sound being used.
- Returns
- A shared pointer to the current impulse response being used.
◆ setImpulseResponse()
void ConvolverSound::setImpulseResponse |
( |
std::shared_ptr< ImpulseResponse > | impulseResponse | ) |
|
Changes the inpulse response used for convolution, it'll only affect newly created readers.
- Parameters
-
impulseResponse | A shared pointer to the new impulse response sound. |
The documentation for this class was generated from the following file: