61 std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> m_irBuffers;
66 std::vector<fftwf_complex*> m_threadAccBuffers;
71 std::vector<std::unique_ptr<FFTConvolver>> m_fftConvolvers;
81 std::shared_ptr<ThreadPool> m_threadPool;
86 std::vector<std::future<bool>> m_futures;
91 std::mutex m_sumMutex;
96 std::atomic_bool m_resetFlag;
101 fftwf_complex* m_accBuffer;
106 std::deque<fftwf_complex*> m_delayLine;
136 Convolver(std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> ir,
int irLength, std::shared_ptr<ThreadPool> threadPool, std::shared_ptr<FFTPlan> plan);
160 std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>>
getImpulseResponse();
166 void setImpulseResponse(std::shared_ptr<std::vector<std::shared_ptr<std::vector<std::complex<sample_t>>>>> ir);
174 bool threadFunction(
int id);
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
float sample_t
Sample type.(float samples)
Definition Audaspace.h:126
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
This class allows to convolve a sound with a very large impulse response.
Definition Convolver.h:41
Convolver(std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > ir, int irLength, std::shared_ptr< ThreadPool > threadPool, std::shared_ptr< FFTPlan > plan)
Creates a new FFTConvolver.
void setImpulseResponse(std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > ir)
Changes the impulse response and resets the convolver.
void getNext(sample_t *inBuffer, sample_t *outBuffer, int &length, bool &eos)
Convolves the data that is provided with the inpulse response.
void reset()
Resets all the internally stored data so the convolution of a new sound can be started.
std::shared_ptr< std::vector< std::shared_ptr< std::vector< std::complex< sample_t > > > > > getImpulseResponse()
Retrieves the current impulse response being used.