CPU-friendly 3D audio spatializer.
More...
#include "SuperpoweredSpatializer.h"
CPU-friendly 3D audio spatializer.
One instance allocates around 140 kb memory. The spatializer class also has one Global Spatializer Reverb instance to simulate "room sound". It collects audio from all Superpowered Spatializer instances and puts a reverb on the signal.
◆ Spatializer() [1/2]
Superpowered::Spatializer::Spatializer |
( |
unsigned int |
samplerate | ) |
|
Constructor.
- Parameters
-
samplerate | The initial sample rate in Hz. |
◆ ~Spatializer()
Superpowered::Spatializer::~Spatializer |
( |
| ) |
|
◆ Spatializer() [2/2]
Superpowered::Spatializer::Spatializer |
( |
const Spatializer & |
| ) |
|
|
private |
◆ operator=()
◆ process()
bool Superpowered::Spatializer::process |
( |
float * |
inputLeft, |
|
|
float * |
inputRight, |
|
|
float * |
outputLeft, |
|
|
float * |
outputRight, |
|
|
unsigned int |
numberOfFrames, |
|
|
bool |
outputAdd |
|
) |
| |
Processes the audio.
It's never blocking for real-time usage. You can change all properties on any thread, concurrently with process().
- Returns
- If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, the contents of output are not changed.
- Parameters
-
inputLeft | Pointer to floating point numbers. 32-bit left channel or interleaved stereo input. |
inputRight | Pointer to floating point numbers. 32-bit right channel input. Can be NULL, inputLeft will be used in this case as interleaved stereo input. |
outputLeft | Pointer to floating point numbers. 32-bit left channel or interleaved stereo output. |
outputRight | Pointer to floating point numbers. 32-bit right channel output. Can be NULL, outputLeft will be used in this case as interleaved stereo output. |
numberOfFrames | Number of frames to process. Valid between 64-8192. |
outputAdd | If true, audio will be added to whatever content is in outputLeft or outputRight. |
◆ reverbProcess()
static bool Superpowered::Spatializer::reverbProcess |
( |
float * |
output, |
|
|
unsigned int |
numberOfFrames |
|
) |
| |
|
static |
Outputs the Global Spatializer Reverb.
Always call it in the audio processing callback, regardless if the effect is enabled or not for smooth, audio-artifact free operation. Should be called after every Superpowered Spatializer's process() method. It's never blocking for real-time usage. You can change all properties of the globalReverb on any thread, concurrently with process().
- Returns
- If process() returns with true, the contents of output are replaced with the audio output. If process() returns with false, the contents of output are not changed.
- Parameters
-
output | Pointer to floating point numbers. 32-bit interleaved stereo output. |
numberOfFrames | Number of framesto process. Should not be higher than 8192. |
◆ azimuth
float Superpowered::Spatializer::azimuth |
◆ elevation
float Superpowered::Spatializer::elevation |
◆ inputVolume
float Superpowered::Spatializer::inputVolume |
◆ internals
spatializerInternals* Superpowered::Spatializer::internals |
|
private |
◆ occlusion
float Superpowered::Spatializer::occlusion |
Occlusion factor (between 0 and 1);.
◆ reverbDamp
float Superpowered::Spatializer::reverbDamp |
|
static |
◆ reverbLowCutHz
float Superpowered::Spatializer::reverbLowCutHz |
|
static |
Global Spatializer Reverb frequency of the low cut in Hz (-12 db point). Default: 0 (no low frequency cut).
◆ reverbmix
float Superpowered::Spatializer::reverbmix |
The ratio of how much audio the Global Spatializer Reverb can collect from this instance (between 0 and 1).
◆ reverbPredelayMs
float Superpowered::Spatializer::reverbPredelayMs |
|
static |
◆ reverbRoomSize
float Superpowered::Spatializer::reverbRoomSize |
|
static |
◆ reverbWidth
float Superpowered::Spatializer::reverbWidth |
|
static |
◆ samplerate
unsigned int Superpowered::Spatializer::samplerate |
◆ sound2
bool Superpowered::Spatializer::sound2 |
Alternative sound option. True on, false off.
The documentation for this class was generated from the following file:
- latest/Superpowered/SuperpoweredSpatializer.h