(self) SOLVED...
this is my code
function DetectStartingPosition: QWORD;
var
buf: array [0 .. 4999] of single;
count, totalSamples: QWORD;
a, b: integer;
thres: single;
streamLength: QWORD;
begin
FillChar(buf, SizeOf(buf), 0);
thres := 0.005;
count := 0;
streamLength := self.duration;
totalSamples := streamLength div 4;
while (BASS_ChannelIsActive(fStream) <> 0) and (count < totalSamples) do
begin
b := BASS_ChannelGetData(fStream, @buf, SizeOf(buf));
b := b div SizeOf(single);
a := 0;
while (a < b) and (Abs(buf[a]) <= thres) do
inc(a);
count := count + a * SizeOf(single);
if a < b then
begin
while (a > 0) and (Abs(buf[a - 1]) > thres / 4) do
begin
Dec(a);
count := count - SizeOf(single);
end;
Break;
end;
end;
result := count;
end;