Applying Echo and Reverb effect

Posted on 2006-04-25
Last Modified: 2012-05-07
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.

Question by:HanuSoftware
    LVL 4

    Accepted Solution

    You can find information an this page: (also code examples)
    LVL 22

    Assisted Solution

    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;


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
    Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now