Author Topic: Shoutcast Metadata ?  (Read 5369 times)

Uwe

  • Posts: 10
Shoutcast Metadata ?
« on: 29 May '03 - 05:20 »
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...

Code: [Select]

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

Code: [Select]

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 ;) ?
« Last Edit: 29 May '03 - 05:20 by Uwe »

Ghostwalker

  • Posts: 35
Re: Shoutcast Metadata ?
« Reply #1 on: 29 May '03 - 06:26 »
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

  • Posts: 10
Re: Shoutcast Metadata ?
« Reply #2 on: 29 May '03 - 06:58 »
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

  • Administrator
  • Posts: 26222
Re: Shoutcast Metadata ?
« Reply #3 on: 30 May '03 - 11:13 »
You forgot the BASS_STREAM_META flag in the BASS_StreamCreateURL call :)

Uwe

  • Posts: 10
Re: Shoutcast Metadata ?
« Reply #4 on: 1 Jun '03 - 01:11 »
if i understand right i have to
Code: [Select]

P1:=BASS_StreamCreateURL(@url[1],0,BASS_STREAM_BLOCK and BASS_STREAM_META,'');


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

DanaPaul

  • Posts: 335
Re: Shoutcast Metadata ?
« Reply #5 on: 1 Jun '03 - 04:36 »

Quote
Code: [Select]

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.

Code: [Select]
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

  • Posts: 10
Re: Shoutcast Metadata ?
« Reply #6 on: 2 Jun '03 - 20:26 »
YES! thx 2 every1 for the Tips...
working now...
:) :)