MATLAB: Is the audio cutoff when a reverb or delay is applied

audiodelayDSP System Toolboxreverb

When adding a delay effect (reverb or delay based) to an audio signal, and using a playback loop consisting of a while ~isDone(dsp.AudioFileReader object), the playback stops as soon as the the dsp.AudioFileReader is finished reading the file. The result is an output which is cutoff because the effect is still processing and the input file is abruptly cut off. The longer the tail length, the more noticeable the cutoff is.

Best Answer

Possible solutions:
  1. Zero pad the input signal, prior to reading it.
  2. Try increasing the samplesPerFrame. This ensures your audio output file will continue processing past the end of the file.
  3. Add another logical condition to the processing loop. Try the line below. This allows you to control the echo effect until the echo gets below a certain level.
while ~isDone(afr) || mean(abs(audioOut)) > .005
Related Question