Skip to content

Commit

Permalink
Corrected example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFi-LoFi committed Mar 31, 2017
1 parent bbd25c7 commit 32c442b
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,41 @@ audio data (e.g. for usage in real-time convolution reverbs etc.).

## Example: FFTConvolver ##

// Some impulse response consisting of 12345 samples
const float* impulseResponse = ...;
const size_t impulseResponseSize = 12345;
// Some impulse response consisting of 12345 samples
const float* impulseResponse = ...;
const size_t impulseResponseSize = 12345;

// Setup the convolver object (block size: 128 samples)
// (typically, this is done in some initialization and not in the audio callback)
fftconvolver::FFTConvolver convolver;
convolver.init(128, impulseResponse, impulseResponseSize);
// Setup the convolver object (block size: 128 samples)
// (typically, this is done in some initialization and not in the audio callback)
fftconvolver::FFTConvolver convolver;
convolver.init(128, impulseResponse, impulseResponseSize);

// Now consecutive audio chunks of arbitrary size can be convolved
// (typically, this is done in the audio callback)
convolver.process(audioIn, audioOut, audioLen);
// Now consecutive audio chunks of arbitrary size can be convolved
// (typically, this is done in the audio callback)
convolver.process(audioIn, audioOut, audioLen);
.
.
.
convolver.process(audioIn, audioOut, audioLen);

## Example: TwoStageFFTConvolver ##

// Some impulse response consisting of 12345 samples
const float* impulseResponse = ...;
const size_t impulseResponseSize = 12345;

// Setup the convolver object
// (typically, this is done in some initialization and not in the audio callback)
fftconvolver::TwoStageFFTConvolver convolver;
const size_t headBlockSize = 64;
const size_t tailBlockSize = 1024;
convolver.init(headBlockSize, tailBlockSize, impulseResponse, impulseResponseSize);
## Example: TwoStageFFTConvolver ##

// Now consecutive audio chunks of arbitrary size can be convolved
// (typically, this is done in the audio callback)
convolver.process(audioIn, audioOut, audioLen);
// Some impulse response consisting of 12345 samples
const float* impulseResponse = ...;
const size_t impulseResponseSize = 12345;

// Setup the convolver object
// (typically, this is done in some initialization and not in the audio callback)
fftconvolver::TwoStageFFTConvolver convolver;
const size_t headBlockSize = 64;
const size_t tailBlockSize = 1024;
convolver.init(headBlockSize, tailBlockSize, impulseResponse, impulseResponseSize);

// Now consecutive audio chunks of arbitrary size can be convolved
// (typically, this is done in the audio callback)
convolver.process(audioIn, audioOut, audioLen);
.
.
.
convolver.process(audioIn, audioOut, audioLen);

0 comments on commit 32c442b

Please sign in to comment.