Wednesday, January 25. 2006Scriptable Lyrics Support
Here's an update on the stuff I'm currently hacking on. I figured it'd be nice to document the progress we're making with amaroK 1.4, which is approaching a first beta release ("Technology Preview") quickly.
In amaroK we have had automatic lyrics fetching support for quite a while. So far we had this lyrics feature hardcoded in C++, as part of the application. Our code would access lyric.com.ar, fetch the html code and transform it to make it suitable for the lyrics tab. While this worked fairly well for a while, two problems with this approach eventually surfaced: 1) It was not possible to select another lyrics site than the one we had chosen. While Lyrc is a good lyrics provider overall, many of our users wished to see their personal favorite lyrics website supported. 2) As most lyrics site (including Lyrc) do not offer a XML based interface, we had to use a screen-scraping technique. This means, amaroK parsed the html code of the site, extracting the desired information from the html code. This has the disadvantage that a simple change in the website's layout may break the parser. And that's what happened: Shortly after the release of 1.3.7, Lyrc changed their html code a bit, and amaroK wasn't abled to fetch lyrics any longer. This had to be fixed in the subsequent 1.3.8 release. Sooooo, what to do? Scripts to the rescue! What I did is, ripped the hardcoded Lyrc code out. Ported the C++ code to Ruby. Then added a couple of DCOP calls and script notifications for the communication Script <--> amaroK. Added a slice of XML, and you get your spicy new Scriptable Lyrics Feature, mmh. What's this techno mumbo jumbo mean for the user? You will be able to: - Write/download lyrics scripts for practically any lyrics site - Upgrade the script in case something breaks - And it means amaroK now depends on Ruby. I like it. Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Would be nice to have more than one lyrics_script running
Though, nice idea, i like ruby ;D
That's actually not needed, because you can make a kind of "mega script", which accesses multiple sites. First site A, then if lyrics not found, site B, and so on.
You could even add a config GUI, so that you can select your preferred order and stuff.
wouldn't it be more intuitive if amaroK would handle this by itself, so you only have to select the lyric scripts in the gui?
The only thing you would have to do is start multiple scripts, with amaroK doing the hard work in the background?
The purported reason for refusing to change the "Delete" option in amaroK's right-click menu to "Move to Trash" was that it would introduce a dependency on kdebase:
http://www.kdedevelopers.org/node/1539 But it's OK for amaroK to depend on Ruby ?! WTF ?!
amaroK doesn't actually depend on ruby.
Lyrics support depends on a script, any script. Right now, the only options available are on ruby, but by the time amaroK is released there should be many available. maybe some even written on bash, c++, or whatever.
I would be happy if you could just DISABLE the delete option. I honestly wonder how many people have actually ever used delete from within amarok, it can't be that many. I guess I now know why lyric fetching randomly stopped working...
If amarok can't find the specific song on the lyrics site it will show some similar ones it thinks it may be, and if you then click on one of them it will show the lyrics properly, which seems very strange!
I like ruby too. But amarok should not depend on any scripting language. We have allready to many scripting languages and dependencies in our linux systems..
Either make the plugin optional (like the other plugins), or us a more common language like python or perl. There exist for sure other ways to make the lyrics engine configurable.
The DCOP interface allows the use of any scripting language (the bundled lyric script is in ruby, thus the dep). If it was a KJS thing, KJS would be the only option. Also this is just adding to what we use already instead of a whole new scripting interface.
I personally agree though, I think exploring actual script bindings (like Plasma) is something worth looking into in the future.
Could those scripts be available to be shown as subtitles? So users would create a lyric karaoke script for it's music, and everybody could download it, and have them displayed in sink with the music.
Jobezone
nice idea! but lirics are not timed so it is not possible..
or maybe with some hardcore speech recognizer?
You're right, but it could work if:
1 - A repository/website was set up to archive the lyrics subtitles 2 - Amarok and all the rest would communicate with it and retrieve the lyric subtitles 3 - Each lyric subtitle would be like a movie subtitle, each piece timed. Every user could create one and put it at the above website
Does it mean that the memory footprint gets even bigger? Amarok uses way to many resources already.
"I figured it'd be nice to document the progress we're making with amaroK 1.4, which is approaching a first beta release ("Technology Preview") quickly."
Yeah, question - will the new search interface already make it into 1.4? How are you progressing on that? It looks great and I missed it terribly since I switched from Yammi to amaroK!
Ohhhhh.... I am so sick of ruby hype. It's not the language that's annoying, just its fans.
As long as the script can be swapped out, all is well with the world!
Woo, custom lyrics, I was just thinking how great that feature would be since I'm getting increasingly annoyed at the fact that lyrc wasn't a wiki because there were many errors and lyrics didn't appear immediatly after being submitted.
lyriki.com here I come!
a wiki for lyrics? you sir, have made my day
thank you very much for this not-as-known-as-it-should-be information.
I have many mp3 with lyrics include in the file as tags
will it work ? |
Amarok LinksCalendar
QuicksearchCategoriesSyndicate This BlogBlog Administration |
||||||||||||||||||||||||||||||||||||||||||

