0

How to display in Label the name of the radio?

procedure TForm1.Button1Click(Sender: TObject);
var
  err: Integer;        
begin
  channel:= BASS_StreamCreateURL('http://stream.laut.fm/schlagerrallyefm', 0,
     BASS_STREAM_BLOCK or BASS_UNICODE, nil, 0);
  if channel <> 0 then
    BASS_ChannelPlay(channel, false);
  err := Bass_ErrorGetCode();
  if err <> 0 then
    ShowMessage('Error #' + IntToStr(err));
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  BASS_init(-1, 44100, 0, Handle, nil);
  BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST, 1);
end;
RepeatUntil
  • 2,272
  • 4
  • 32
  • 57
martynika
  • 1
  • 3
  • What name are you expecting from that stream? Is it possible you want the value of the `icy-description` or `icy-name` HTTP headers that it returns? – Rob Kennedy May 15 '17 at 19:50
  • How? The decision I leave to what is better is to know it. I'm just starting. And please just a simple example – martynika May 15 '17 at 20:21
  • I ran `wget -S url -O foo`, then canceled the command after a moment. The output included the headers that the server returns. The file _foo_ contains the audio stream, and I deleted it. If the HTTP headers contain the information you need, then the solution is to get the HTTP headers from somewhere. If it's instead the audio stream that contains your desired information, then you'll need a different solution. It would help you _you_ knew what information you were _expected_ to get; it makes it much easier to recognize the solution when you see it. – Rob Kennedy May 15 '17 at 21:22

0 Answers0