well
i tried to use Device "0" (no device) , and decoded chanel.
spending a long time to change the code from: C Style to Delphi Style , .
it is working now ,
But i have this problem:
it is playing the stream Very Fast (2X or 4X time)
snip :
BASS_StreamFree(uStream); // close old stream
BASS_SetDevice(0);
uStream:=BASS_StreamCreateURL(Pchar(URL),0,BASS_STREAM_DECODE or BASS_UNICODE ,nil,nil);
track := TJAudioTrack.JavaClass.init(3,44100,3,2, TJAudioTrack.JavaClass.getMinBufferSize(44100,3,2),1);
track.play;
jbuffer:= TJavaArray<SmallInt>.Create(20000);
res:=BASS_ChannelGetData(uStream, @buffer[1],Length( buffer));
while (res <> -1) do
begin
if res > 0 then
begin
...
some code here
...
track.write( jbuffer,0,res ) ;
end
else try
Sleep(250);
except end;
res:=BASS_ChannelGetData( uStream, @buffer[1], Length( buffer)); // decode some data
end;