P1:=BASS_StreamCreateURL(@url[1],0,BASS_STREAM_BLOCK and BASS_STREAM_META,'');
Well, first thing, if variable "URL" is a string (not "ShortString") then I religiously typecast these strings as a PChar directly. This (in my humble opinion) ensures that the compiler understands that we want a null char at the end of the current string length.
P1:=BASS_StreamCreateURL(PChar(url), 0, BASS_STREAM_BLOCK or BASS_STREAM_META, '');
Secondly, and this is an
important point, you must use bitwise operand "
OR" to combine flags, not boolean evaluation result "
AND".
Incidently, the example you posted works well with "ShortString" if you are sure that a null char exists after the last char of the current string length
and the current length of the string (URL) is not 255 chars (max shortstring length).
Make sense?