This class represents a sound that can sound different depending on its realtive position with the listener.
More...
#include <BinauralSound.h>
This class represents a sound that can sound different depending on its realtive position with the listener.
◆ BinauralSound() [1/2]
BinauralSound::BinauralSound |
( |
std::shared_ptr< ISound > | sound, |
|
|
std::shared_ptr< HRTF > | hrtfs, |
|
|
std::shared_ptr< Source > | source, |
|
|
std::shared_ptr< ThreadPool > | threadPool, |
|
|
std::shared_ptr< FFTPlan > | plan ) |
Creates a new ConvolverSound.
- Parameters
-
sound | The sound that will be convolved. It must have only one channel. |
hrtfs | The HRTF set that will be used. |
source | A shared pointer to a Source object that contains the source of the 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 HRTF object provided.
◆ BinauralSound() [2/2]
BinauralSound::BinauralSound |
( |
std::shared_ptr< ISound > | sound, |
|
|
std::shared_ptr< HRTF > | hrtfs, |
|
|
std::shared_ptr< Source > | source, |
|
|
std::shared_ptr< ThreadPool > | threadPool ) |
Creates a new BinauralSound.
A default FFT plan will be created.
- Parameters
-
sound | The sound that will be convolved. Must have only one channel. |
hrtfs | The HRTF set that will be used. |
source | A shared pointer to a Source object that contains the source of the 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 hrtfs.
◆ createReader()
virtual std::shared_ptr< IReader > BinauralSound::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.
◆ getHRTFs()
std::shared_ptr< HRTF > BinauralSound::getHRTFs |
( |
| ) |
|
Retrieves the HRTF set being used.
- Returns
- A shared pointer to the current HRTF object being used.
◆ getSource()
std::shared_ptr< Source > BinauralSound::getSource |
( |
| ) |
|
Retrieves the Source object being used.
- Returns
- A shared pointer to the current Source object being used.
◆ setHRTFs()
void BinauralSound::setHRTFs |
( |
std::shared_ptr< HRTF > | hrtfs | ) |
|
Changes the set of HRTFs used for convolution, it'll only affect newly created readers.
- Parameters
-
hrtfs | A shared pointer to the new HRTF object. |
◆ setSource()
void BinauralSound::setSource |
( |
std::shared_ptr< Source > | source | ) |
|
Changes the Source object used to change the source position of the sound.
- Parameters
-
source | A shared pointer to the new Source object. |
The documentation for this class was generated from the following file: