Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ConvolverSound Class Reference

This class represents a sound that can be modified depending on a given impulse response. More...

#include <ConvolverSound.h>

Inheritance diagram for ConvolverSound:
Inheritance graph
[legend]

Public Member Functions

 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.
 
 ConvolverSound (std::shared_ptr< ISound > sound, std::shared_ptr< ImpulseResponse > impulseResponse, std::shared_ptr< ThreadPool > threadPool)
 Creates a new ConvolverSound.
 
virtual std::shared_ptr< IReadercreateReader ()
 Creates a reader for playback of the sound source.
 
std::shared_ptr< ImpulseResponsegetImpulseResponse ()
 Retrieves the impulse response sound being used.
 
void setImpulseResponse (std::shared_ptr< ImpulseResponse > impulseResponse)
 Changes the inpulse response used for convolution, it'll only affect newly created readers.
 
- Public Member Functions inherited from ISound
virtual ~ISound ()
 Destroys the sound.
 

Detailed Description

This class represents a sound that can be modified depending on a given impulse response.

Constructor & Destructor Documentation

◆ 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
soundThe sound that will be convolved.
impulseResponseThe impulse response sound.
threadPoolA shared pointer to a ThreadPool object with 1 or more threads.
planA 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
soundThe sound that will be convolved.
impulseResponseThe impulse response sound.
threadPoolA 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.

Member Function Documentation

◆ 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
ExceptionAn exception may be thrown if there has been a more unexpected error during reader creation.

Implements ISound.

◆ getImpulseResponse()

std::shared_ptr< ImpulseResponse > ConvolverSound::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
impulseResponseA shared pointer to the new impulse response sound.

The documentation for this class was generated from the following file: