В процедуре Generator:
Код:
j: integer;
const mass: array [0..2] of integer = (1000, -1000, 2000);
Код:
for j := 0 to Length(mass)-1 do begin
if mass[j] > 0 then begin
OmegaC := 2*PI*Freq;
for I := 0 to Size div 2 do begin
t := I/44100 + tPred;
PSmallInt(buf)^ := Round(Lev*sin(OmegaC*t));// ВОЗНИКАЕТ ОШИБКА
Inc(PSmallInt(buf));
end;
tPred := t;
end;
if mass[j] < 0 then begin
for I := 0 to Size-2 do begin
PSmallInt(buf)^ := 0;
Inc(PSmallInt(buf));
end;
tPred := 0;
end;
if j = Length(mass)-1 then ServiceThread.Terminate;
end;
Возникает ошибка
И как делать "задержки", которые в массиве?