Applying Echo and Reverb effect

Dear Experts,

We have a LPVOID type of buffer which stores data corresponding 1 second of a wave file( 16 bit, 2 channel  and 44.1Khz).
That is, at one time it stores 176400 bytes of audio data.
Kindly let me know the algorithm of applying Echo and Reverb effect on the one second buffer.

Who is Participating?
chip3dConnect With a Mentor Commented:
You can find information an this page: (also code examples)
grg99Connect With a Mentor Commented:
Echo  algorithm:

EchoSpacing := EchoSeconds * SampleRate;  EchoVolume := 0.3333;

for i := 0 to TheEnd - EchoSpacing do  data[ i + EchoSpacing ] += data[ i ] * EchoVolume;

Reverb is the same, only repeated at decreasing volume:

EchoSpacing := EchoSeconds * SampleRate;  EchoVolume := 0.3333;  ReverbTimes := 5;

for i := 0 to TheEnd - EchoSpacing do  
                  Rvol := EchoVolume; Where := i + EchoSpacing;
                  for j := 1 to ReverbTimes do
                         data[ Where ] += data[ i ] * RVol;
                         RVol /= EchoVolume;  Where += EchoSpacing;

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.