Author Topic: Building a radio - stream player in Delphi [Me=Bloody Newb]  (Read 8562 times)


  • Posts: 3
Dear Unseen board members,

I've started using Delphi just some weeks ago, it's my very first programming language, and as I was told it was the easiest one to learn, I decided to give it a try. Bass.dll is my first approach at creating "something bigger" than just solving mathematic problems.

Since about 4 days I desperately try to create a tool for listening to online streams, no fancy x-traz, just the bare listening thing.

Sofar, I learned that I need the "BassPlayer.pas" and the .dll file, but I have no idea however how I can create a small program that will just open the internet stream and play it. The bass.chm help-file didn't help me either, because it seems there's quite some "high" programming knowledge needed for understanding.

I already searched the web for an example program I could look at, to learn how I can open streams, but all I found was programs that opened local files (like .mp3).

So, my question is, does anybody of you know an example I could have a look at? Maybe a really easy one, so my newbish-brain would understand the whole sourcecode ?!

- Max


  • Posts: 69

Welcome to the wonderful world of Delphi !

Start learning the "netradio" sample in the Delphi folder of the distro zip file.



  • Posts: 3

Thanks for the great advice, but I still have a problem. When opening the netradio source, whenever I try to compile I get the error(s):

  [Fehler] Unit1.pas(116): Undefinierter Bezeichner: 'BASS_STREAM_STATUS'
  [Fehler] Unit1.pas(116): Zu viele Parameter
  [Fehler] Unit1.pas(126): Undefinierter Bezeichner: 'BASS_FILEPOS_END'
  [Fehler] Unit1.pas(127): Undefinierter Bezeichner: 'DW_Error'
  [Fehler] Unit1.pas(129): Undefinierter Bezeichner: 'BASS_FILEPOS_DOWNLOAD'
  [Fehler] Unit1.pas(130): Undefinierter Bezeichner: 'BASS_FILEPOS_CURRENT'
  [Fehler] Unit1.pas(138): Undefinierter Bezeichner: 'BASS_ChannelGetTags'
  [Fehler] Unit1.pas(156): Undefinierter Bezeichner: 'BASS_ChannelPlay'
  [Fehler] Unit1.pas(193): Undefinierter Bezeichner: 'BASSVERSION'
  [Fehler] Unit1.pas(198): Zu viele Parameter
  [Fehler] Unit1.pas(203): Undefinierter Bezeichner: 'BASS_SetConfig'
  [Fehler] Unit1.pas(203): Undefinierter Bezeichner: 'BASS_CONFIG_NET_PLAYLIST'
  [Fehler] Unit1.pas(204): Undefinierter Bezeichner: 'BASS_CONFIG_NET_PREBUF'
  [Fehler] Unit1.pas(205): Undefinierter Bezeichner: 'BASS_CONFIG_NET_PROXY'
  [Fehler] Unit1.pas(229): Undefinierter Bezeichner: 'BASS_SetConfig'
  [Fehler] Unit1.pas(229): Undefinierter Bezeichner: 'BASS_CONFIG_NET_PROXY'
  [Fataler Fehler] netradio.dpr(6): Verwendete Unit 'Unit1.pas' kann nicht compiliert werden

I suppose "Undefinierter Bezeichner" (which is German actually) could be translated with "Non-predifined identifier", actually, I think it's supposed to say, that the function / command used in the netradio source can't be found!

Sofar I imported "bass.pas" as a component (component->install component) and copied it over to my "Lib" folder. Additionally, copies of "bass.pas" and "bass.dll" are placed in the program's folder.

I just can't understand why Delphi (I use Delphi 7) doesn't find these commands!

I would be really glad if somebody could help me -
I did not modify the netradio source, so I think it actually should work. Is there something I forgot while importing the "bass.pas" ?
Do I have to do anything aditionally than just adding the component to delphi by installing it and copying it over !?

- Max


  • Posts: 69
I just can't understand why Delphi (I use Delphi 7) doesn't find these commands!
Look at the source of the project ("project / See source" or whatever it is written in German [I'm french]), and you'll see :
Code: [Select]
  Unit1 in 'Unit1.pas' {Form1},
  Bass in '..\Bass.pas';
Notice the " ..\ " !, which means "up one level", so put bass.pas in the same folder as the project you are working on and remove " ..\ ".
Or simply use "bass.bpg" to open all that Delphi stuff... (but maybe you should start learning how Delphi works ?).
No need to install Bass.pas.

An yes, you *must* put bass.dll in the same folder as the .exe to get it happy !


  • Posts: 3
Oh my gosh, it finally works!

Im so friggin' glad ;-).
works like a charm!

thx a bunch,
& merci beaucoup ^^

- Max