17 Feb 2003 Stevey   » (Master)

Brain Wave!

 I've just had one of those brainwave moments where you realise the solution to a problem - then kick yourself for not seeing it before.

 It's at moments like these where I feel a combination of pride and humbleness. Life is good.

The Problem

 For those that are interested - the problem and my cunning solution.

 I've been working on an MP3 server, which has been almost discussed to death here.

 Anyway there server presents an interface to the music assessible through a web browser, along with a preferences page.

 Many users want to be able to choose the bitrate of the songs they listen to via the preferences page - but I've always said "No that can't work".

 Essentially the problem is that the user may set preferences which will be stored as cookies, but when a playlist is generated the users MP3 player will make the requests for the songs, and not send cookie information - meaning that bitrates cannot be set.

 I just realised that I can do better than this; when the server is asked for a playlist it can alter what is sent to the user, such as:

http://server.somwhere.org/path/to/file.mp3-low
http://server.somwhere.org/path/to/file.mp3-low
http://server.somwhere.org/path/to/file.mp3-low

 The MP3 player will request 'file.mp3-low' and at this point the server knows that "file.mp3" exists, so it can do the downsampling in "low" mode and send it to the player.

 Problem solved.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!