Author Topic: Delphi Demo how opnen hurl and play (file)  (Read 134 times)

Daniele

  • Posts: 5
Delphi Demo how opnen hurl and play (file)
« on: 30 Apr '21 - 09:48 »
Good morning to all,
  i'm new with this library and i'm moving first step.
In library file is present web radio demo for delphi.
It's run good and is possible play the 10 web radios in the demo.
But how it's possible play any other web radio according to it's own hurl?

This is original array

  urls: array[0..9] of AnsiString = ( // preset stream URLs
   'http://www.radioparadise.com/m3u/mp3-128.m3u', 'http://www.radioparadise.com/m3u/mp3-32.m3u',
   'http://icecast.timlradio.co.uk/vr160.ogg', 'http://icecast.timlradio.co.uk/vr32.ogg',
   'http://icecast.timlradio.co.uk/a8160.ogg', 'http://icecast.timlradio.co.uk/a832.ogg',
   'http://somafm.com/secretagent.pls', 'http://somafm.com/secretagent24.pls',
   'http://somafm.com/suburbsofgoa.pls', 'http://somafm.com/suburbsofgoa24.pls'

all work fine but if i try to change some link i got an error  (error code 2)

The hurl i try to open are

http://radiodeejay-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8
http://icecast.unitedradio.it/r101

Booth are played in XMPlay.

Can you give me some help on how to "listen" this file in delphi demo?

Thank's for any reply and excuse me if this question is in a wrong place.

Have a nice day

Daniele

Ian @ un4seen

  • Administrator
  • Posts: 23640
Re: Delphi Demo how opnen hurl and play (file)
« Reply #1 on: 30 Apr '21 - 16:41 »
Error code 2 is BASS_ERROR_FILEOPEN, which means BASS couldn't open the URLs. Both of those URLs are working fine here, so I'm not sure why you would be getting that error there. To perhaps narrow it down, please see if you can reproduce the problem with the pre-compiled NETRADIO.EXE example included in the BASS package (C\BIN folder), ie. paste the URLs in the "Custom" box.

Note the first URL (http://radiodeejay-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8) is HLS, so you will need the BASSHLS add-on to play that one. Put the BASSHLS.DLL file alongside your EXE and add this to your initialization code:

Code: [Select]
BASS_PluginLoad('basshls.dll', 0 {$IFDEF UNICODE} or BASS_UNICODE {$ENDIF});

Daniele

  • Posts: 5
Re: Delphi Demo how opnen hurl and play (file)
« Reply #2 on: 3 May '21 - 11:00 »
Good morning Ian,
  thank you for yoyr reply.

I try your suggestions and i run the NetRadio.Exe program after copy BASSHLS.DLL in the same directory.
The player is able to read and play, almost, all the link i tested.
Almost becaouse some "strange" link are not "recognized" and fireup errors code 2 and 40.

Some of this link are

http://shoutcast.rtl.it:3060/ (error code 40)
http://wma08.fluidstream.net:4610/ (error code 40)
http://onair18.xdevel.com:8014/ (Error code 2)
rtsp://live.media.rai.it/broadcast/radiodue.rm (Error code 2)

Loaded the netradio in delphi 10.4 ide, put the address

http://radiodeejay-lh.akamaihd.net/i/RadioDeejay_Live_1@189857/master.m3u8

in the hurl array first place and copy del BASSHLS.DLL in the exe directory, i have the error code 2

NetRadio demo for C (c\bin) is a little different from netradio demo for delphi (c version have the possibility to insert manually one hurl).
Is possible have the update demo version for delphi ?

Thank you for your help.

Best Regards
Daniele


 

Chris

  • Posts: 1945
Re: Delphi Demo how opnen hurl and play (file)
« Reply #3 on: 3 May '21 - 12:38 »
Hi
here a l little modified/update Delphi NetRadio Demo (Rio)
(Plugins must be in the same directory as Bass.dll)
« Last Edit: 3 May '21 - 18:16 by Chris »

Ian @ un4seen

  • Administrator
  • Posts: 23640
Re: Delphi Demo how opnen hurl and play (file)
« Reply #4 on: 3 May '21 - 15:38 »
The player is able to read and play, almost, all the link i tested.
Almost becaouse some "strange" link are not "recognized" and fireup errors code 2 and 40.

Some of this link are

http://shoutcast.rtl.it:3060/ (error code 40)
http://wma08.fluidstream.net:4610/ (error code 40)
http://onair18.xdevel.com:8014/ (Error code 2)
rtsp://live.media.rai.it/broadcast/radiodue.rm (Error code 2)

The 2nd link is working here. Perhaps the server was temporarily down when you tried it? The 1st and 3rd links appear to be dead and not playing with any software. Are you able to play them with other software there? Unfortunately, the 4th link won't work with BASS because it doesn't support RTSP.

NetRadio demo for C (c\bin) is a little different from netradio demo for delphi (c version have the possibility to insert manually one hurl).
Is possible have the update demo version for delphi ?

The Delphi examples were kindly provided by other BASS users but that does mean that they may not always be up to date with the C examples. So if you can read C code, it is a good idea to look at the C examples first for reference.

Daniele

  • Posts: 5
Re: Delphi Demo how opnen hurl and play (file)
« Reply #5 on: 12 May '21 - 08:36 »
Good morning Ian,
  thank you for you reply and for delphi example (thank's Chris).

In a very fast test, only few links does not work (broken link, unsupported format ecc..) and the main radios i will put in my program ... all of them work ... (listen)
I do not know C, C++ programming, so i'm limited to delphi (this can be bad !!)

Thank's for your assistance and excuse me for delay in reply.

Best regards
Daniele