badcomputer.org
Sunday, September 24, 2006
New software: flacinfo-rb
I was looking for a way to read tags from flac files for sneetchalizer. After some searching I realized there was no such library for Ruby, and not wanting a dirty hack (like parsing `faad -i` like I do for m4a tags) I decided to write it myself. After writing wmainfo-rb, it was very pleasant to read and implement a _nice_ spec like the Flac spec. The ASF spec is nothing but pain. I have heard that the ID3v2 spec is needlessly comvoluted as well.
Anyway, if you want access to metadata from Flac files, including the seektable and other arcane bits of information, and you want to do it using Ruby then give my library a try. You can read the flacinfo-rb info page on my site or just grab it directly from the rubyforge. I also have plans to port it to Python soon, as there seems not to be a Python Flac library either.
Updated software: sneetchalizer
I also updated the sneetchalizer to use said library, as well as a thousand other little fixes. So, if you want to convert between various audio codecs, or resample your current files, go have a look at sneetchalizer. I have also written an sneetchalizer ebuild that you might like to try. If you do and you have 'flac' in your USE flags then it will depend on flacinfo-rb-0.1.ebuild and if you have 'wma' it will depend on wmainfo-rb-0.3.ebuild.
*.k3b --> *.m3u
One more little chunk of code you may find useful. I like to burn CDs using K3b, but I like to listen to them before I burn them. Before I had to create the tracklisting in K3b, then redo the whole procedure in xmms. Very annoying, so I wrote this code:
file = File.basename(ARGV[0], ".k3b")
system("unzip '#{ARGV[0]}'")
fp = File.open("#{file}.m3u", "w")
IO.foreach("maindata.xml") do |line|
outline = line.split[-2].gsub("\"","'") if line =~ /<file/
if outline
fp.write("#{outline.split("'")[1]}\n")
end
end
fp.close()
File.unlink("maindata.xml")
File.unlink("mimetype")
Use like: $ ruby playlist.rb "My Cool CD.k3b" and it will create "My Cool CD.m3u" so you can listen to your 'CD' before you burn it, or after you've moved it to your car or whatever.
stats
It is
Saturday May 17, 2008 2:35 pm
This page served 1310 times
This page last modified: April 14, 2008 11:29 am
Your IP address is: 38.103.63.17
You are browsing using: CCBot/1.0 (+http://www.commoncrawl.org/bot.html)
You are browsing from: United States.
badcomputer.org's uptime: 14:35:39 up 23 days, 15:17, 0 users, load average: 0.00, 0.00, 0.00
local
home | unix stuff | dir2ogg | sneetchalizer | wmainfo | q&d guide to permissions | q&d guide to tar and gzip | code | MS rant | browser shootout | linux & iAudio X5 | photos | music | programming poetry | sieve of Eratosthenes | plea | rain | suffer | archive | about | recipes | compaqr3000 | sitemap
search
credits
This page, and all pages on this site were created and are maintained by Darren Kirby using valid XHTML 1.0 and CSS, and are ©copyright 2002 - 2008. The Penguin image was created by Tukka, and is used by permission. Inspiration for the look of this site was provided by Eric A. Meyer's CSS gallery. This website runs on Gentoo Linux. It is served by Apache. PHP and MySQL hold together the backend.