Jump to content

Audioscrobbling an icecast stream


cooper

What to do?  

8 members have voted

  1. 1.

    • Google harder
      2
    • If you coded it, you'd be done by now
      1
    • Good question
      1


Recommended Posts

I'm trying to get the same music playing throughout my house, and I figured setting up an Icecast server to do this would be ideal. So far, it's working really nice. There's just one small problem: My last.fm stats aren't being updated.

This is, to some extent, understandable I suppose. The player probably doesn't get all the info it needs from the server. Still, I'd very much like to have audioscrobbler support for this setup. So, I go to the source and look at ices (my entire collection is MP3, and ices2 is OGG-only it seems). There's no audioscrobbler integration in it at all. I've done some googling and it would appear no such beast exists yet.

Now, before I go on a coding rampage to add this enhancement to ices, does anybody perhaps know of an alternative program that can feed an icecast server, yet also has audioscrobbler support? It must be for UNIX, headless, commandline-driven and support random play of a pretty big (about 1 million) collection of songs.

Link to comment
Share on other sites

Interesting. Close, but the clients for it are a tad remote from what I'm looking for. But I could of course just make a client for it and be done with it...

Interesting.

Link to comment
Share on other sites

Again thank you. This icecast shit is great.

While setting up an icecast server box while at work ( got it streaming via ssh. Fast box, 1 meg upload..meh). I found this little ditty:

amaroK

There’s a very simple reason I chose amaroK and that is the availability of a Python script called ices-metadata which plugs into amaroK and sends correct track metadata to Ices. Upon installation of this script in amaroK change the configuration to reflect the location of the Ices pid and metadata files we set above. Using this the correct track and artist names are supplied with your stream.

Click here for the full thread.

Hope it helps.

Link to comment
Share on other sites

The thing is that they're using amaroK to feed music into ices. As the music is local to the machine ices is running on, and all my MP3's are properly tagged, I can simply let Ices play the music on its own. Simply add this playlist element to the ices configuration:

<Playlist>

    <!-- This is the filename used as a playlist when using the builtin 

         playlist handler. -->

    <File>/path/to/your/playlist.txt</File>

    <!-- Set this to 0 if you don't want to randomize your playlist, and to

         1 if you do. -->

    <Randomize>1</Randomize>

    <!-- One of builtin, perl, or python. -->

    <Type>builtin</Type>

    <!-- Set this to the number of seconds to crossfade between tracks.

         Leave out or set to zero to disable crossfading (the default).-->

    <Crossfade>5</Crossfade>

</Playlist>

With this in place, Ices randomly picks a track from the playlist file (find /path/to/music/dir -type f -name *.mp3 > /path/to/your/playlist.txt) and plays it, plus it now overlaps the last 5 seconds of the current song with the first 5 seconds of the next one.

The player that takes in the stream is provided with bandname and songname, straight from the ID3v2 tag.

The only problem is that that data is provided to the player as a string, and it doesn't know enough about it to make it accept it as information that can be provided to last.fm. But ices keeps a .CUE file on the filesystem which contains metadata from the file it's currently playing, including the full path to the file. With some creative scripting and an ID3v2 tag reading program it should be quite doable to extract the needed information and provide it to last.fm for updating my stats. I just haven't done that yet. :)

Link to comment
Share on other sites

Yup sounds like a plan. Where precisely does the server dump the tag information? I'd love to write a little bash script to 'scrob' too. Maybe we can compare solutions?

I'm setting up ssh key batch files for my friends work windows PC's (it'd be so much easier for people as lazy as myself if every body in the world used a UNIX like OS) now. I'll probably use coppssh or something Going to have little radio station between friends.

I downloaded ices-2.3.1 (I think) and discovered it can only play oggs. Most of my collection are a bunch of ogg's, but I do have a number in mp3 format. Then discovered ices-0.4.x. The -R switch in ices seems to convert oggs to mp3's on the fly. Ices is a thing of beauty. Lossy to lossy is not good but this is simplicity in itself.

/usr/local/bin/ices -h 127.0.0.1 -p 8000 -P pass -m myNoise -r -s -i -R -v

Although the docs could be better. I must find out how the -s (private stream) and the -i, (use icy headers) switches work.

Might even help the project..... who am I kidding, full time employment + love of wine and women does not make one helpful.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...