Shoutcast Metadata ?

Started by Uwe,

Uwe

First let me thank you for BASS! Great work!

I'm trying to code a little Player in Delphi
that connects to a Shoutcast Server...
Works fine till here...
Now i'd like to add the StreamTitle/Songtitle but
i did not recv any Meta-Information...

Here's my Code...

procedure MetaProc(const Handle: HSYNC; Channel, Data, User: DWORD); stdcall;
begin
...some teststuff like Captions a.s.o. ...
end;

Connecting and "sync-setup" is done like

P1:=BASS_StreamCreateURL(@url[1],0,BASS_STREAM_BLOCK,'');
BASS_StreamPlay(P1,False,0);
BASS_ChannelSetSync(P1,BASS_SYNC_META, 0, @MetaProc, 0);

Metaproc never executed... But i don't know why..

Any Idea's ;) ?

Ghostwalker

hi,

try BASS_STREAMGETTAGS...this should give you the info, if it's send from the server.

Another way to get infos, is to access the server direct (you need the password). Then you can get the XML-statistics from the server.

Greetings Ghostwalker

Uwe

Hmm... I've tried BASS_StreamGetTags b4 but
i could'nt decide how often i should use this
(in a Timer f.e.) anyway, same results,no metaInfo.
I know, i could query the Server via HTTP but thats
not the way i want to. Where4 are the MetaData ? ;)


Ian @ un4seen

You forgot the BASS_STREAM_META flag in the BASS_StreamCreateURL call :)

Uwe

if i understand right i have to
P1:=BASS_StreamCreateURL(@url[1],0,BASS_STREAM_BLOCK and BASS_STREAM_META,'');

(sorry, i'm not really a expert... YET ;)

DanaPaul


QuoteP1:=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? :)

Uwe

YES! thx 2 every1 for the Tips...
working now...
 :) :)