Internet radio

Blitz3D Forums/Blitz3D Programming/Internet radio

Naughty Alien(Posted 2007) [#1]
..is there any way to use internet radio (any) as a background music in 3D aplication, game, whatever done in B3D??


GfK(Posted 2007) [#2]
I guess its possible... probably going to cause horrible lag though without multithreading.

What led you to think that this was the way forward? o.O


Matty(Posted 2007) [#3]
I just tried it using the following:

execfile "url to streamed music location"



It brought up the little window "open or save as" before playing as normal.

So I guess as GfK says it is possible. I don't think it would cause any lag though as I've often had streamed music running from di.fm while playing some of my blitz games with no problem, although didn't call them from within the blitz game.


LAB[au](Posted 2007) [#4]
Use BASS library, if I remember well Vertex did an example of streaming radio with it


stayne(Posted 2007) [#5]
Most stations stream as .pls files. Winamp is the only app I know that will stream those. I'm sure there's another type of stream, but that's beyond my knowledge.


Rroff(Posted 2007) [#6]
pls files are just a playlist, in this case they are used as the "middleman" between your web browser and your audio player to make your audio player connect to the correct IP to recv the streaming data...

realisitically to do this within a b3d app your going to need an external dll... it shouldn't be that big a hit on performance, on modern PCs I see no performance difference when playing a game with winamp running in the background, and even on fairly old PCs your only going to see a ~10% performance impact.

As most streams use an mp3 codec (other than ones using wma/asf or real audio) it might be possible, tho I'm doubtful, to capture the segments, write some headers on them maybe and then play them through b3d's built in sound system... however it would need some decent knowledge of the stream protocol (I believe the shoutcast sight might have some docs on this) and I don't know whether b3d could play back the segments gaplessly...


Rroff(Posted 2007) [#7]
EDIT seems shoutcase just uses some http headers and then sends the audio data straight afterwards with provision for more meta data i.e. to send titles when the track changes.