Hello everybody.
OK, I have perfect result with equalizer using fft BandReject filter and a BandPass filter * gain.
Now I am busy for a "
Playing Reverse" feature.
I have very good result using this:
At each thread-loop, before to read the audio-source, there is a seek at audio-source.position -
(length(buffer-samples) div channels).
When the buffer-samples is filled, a fft do this:
type
TArFloat = array of cfloat;
function DSPReverse(var Buffer: TArFloat): TArFloat;
var
x: integer = 0;
lengthbuf: integer;
arfl: TArFloat;
begin
lengthbuf := length(Buffer);
SetLength(arfl, lengthbuf);
x := 0;
while x < lengthbuf do // Buffer is stereo.
begin
arfl[x] := Buffer[lengthbuf - x -1]; // Is it the right way ?
arfl[x + 1] := Buffer[lengthbuf - x - 2]; // Is it the right way ?
Inc(x, 2);
end;
Result := arfl;
end;
end;
This indeed produces a reverse sound but if the level of the samples is high, there is some "click" and "clack" in the sound.
Does somebody have a idea why, maybe the inversion of the samples is not ok?
Inverting the phases did not help (sample := -1 * sample).
Thanks.
Fre;D
[EDIT]
OK, fixed,
lengthbuf must be l
ength(Buffer) div channels.
Now, no more "click" nor "clack" but a perfect reversed sound.
Time to do a great scratching console.
Sorry for the noise.