Tonight I worked on the Directory listing functionality for Banshee. Basically, in Banshee, you will be able to subscribe to many directory listings, such as dir.xiph.org.
So I wrote some code that gives you a generic “RadioStation” object and an abstract “DirectoryService” class that you implement to get a list of “RadioStation”s from the remote datasource.
I wrote a test app that grabs the XML Directory listing for Xiph, parses it into RadioStation and prints out the result. Here is an example:
Name: ..:::: WapFM ::: Eteryje: Server [Rtz_] ::::..
Genere: #WapFM
Bitrate: 32kps
Uri: http://www.unixas.com:8000/stream
Name: .:[ Ultra Hits Radio ]:. [ Blazing Non-Stop Hit Music 24/7 ]
Genere: Top 40, Hip Hop, RnB, Urban
Bitrate: 128kps
Uri: http://68.9.224.144:8000/live.mp3
Name: 000-www.jamaicans.tv-000 - Intl Dancehall Queen Vol3 and How Fi Dance Reggae Vol1 - dancehall 300kbp
Genere: Dancehall Reggae
Bitrate: 300kps
Uri: http://64.182.1.110:9110/stream.nsv
EDIT
Seems Xiph print out a new station entry for every different bit rate, even for the one “station”. So I made a little change so that a RadioStation can have multiple radio streams.
For example:
Name: WBAR - Barnard College Radio (aim: wbarrequest)
Genere: College
This station has 4streams available:
#0 Bitrate: 0kps at http://wbar.org:8000/wbar-lo.ogg
#1 Bitrate: 0kps at http://wbar.org:8000/wbar-hi.ogg
#2 Bitrate: 24kps at http://wbar.org:8000/wbar-lo.mp3
#3 Bitrate: 128kps at http://wbar.org:8000/wbar-hi.mp3
And for some reason Icecast reports incorrect bit rates for ogg streams.
Posted in My Brain | No Comments »