Author Topic: OPUS Encode and Decode  (Read 615 times)

nikos

  • Posts: 63
Re: OPUS Encode and Decode
« Reply #25 on: 12 Aug '19 - 18:11 »
I translate the code to

todo:=length;
   while (true)  do
  begin
      DaCritical.Enter();
     done:=EncodeStream.Read(buffer, todo);
      DaCritical.Leave;
      buffer:=Pbyte(buffer)+done;
      todo:=todo-done;
      if (todo<=0) then  break;
      if EncodeStream=nil Then          break;

end;
   result:= length-todo;

i hope this is correct i ask stackoverflow for convartion i wait until tommorow for an answer :)

« Last Edit: 12 Aug '19 - 18:37 by nikos »

nikos

  • Posts: 63
Re: OPUS Encode and Decode
« Reply #26 on: 13 Aug '19 - 09:58 »
******************  FINAL IT WORKS  ************

The only problem is that when i start decode it takes a while to start play the channel?
can i do anything for it?


here is my final bass_read proc

Code: [Select]
var ABuffer : ^TMemorystream;
begin
result:=0;
todo:=length;
inc(total,todo);
ABuffer:=user;
while ABuffer^.size<Total do begin application.ProcessMessages; end;
CopyMemory(ABuffer^.memory, buffer,todo,total-todo);
result:=todo;

and WORKS!!!!!!!!!
But i stick with ancompressed data 11025 as i see its the fastest way with no delay
« Last Edit: 13 Aug '19 - 11:21 by nikos »