stephantom
March 8th, 2008, 04:29 PM
Step right up folks, gaze upon the miracle of all file thumbnailers because I am happy to present to you a shiny new script to do just that.
http://img3.imagebanana.com/img/05lji7bf/Screenshot.png
Yup, it generates thumbnails from your audio files (mp3 and flac to be precise).
The magic is done through extracting three seconds of audio data from the input file (starting from 00:10 because a lot of songs tend to have silence at the beginning).
So the files will have to have a minimum length of 13 seconds or they don't get a thumbnail.
The extraction is done using sox - a really wonderful tool for song editing - which also converts it to raw text data. This textual data is then trimmed and fed to gnuplot which produces the graph. The composite tool from the ImageMagick project then helps us to overlay an icon.
I'll attach a debian package to this post (it depends on sox, gnuplot and imagemagick). It's essentially just a bash script, so it should work on other architectures than i386, I guess.
Things you can customize:
If you know your way around gnuplot you can probably change the color of the graph (currently it's red) or tweak it otherwise. Please let me know what you're doing and show examples! :-)
You can replace the music note icon with any file you like (it's in /usr/share/audiothumb/overlay.png). Just try have it about the same size (or adjust the placement options in /usr/bin/audiothumb [line 12]).
Things I can't figure out right now:
How to get rid of the frame/border that nautilus draws around every thumb. I imagine the thumbs would look nicer without them. Anyone know how to turn them off?
How to enable this for ogg vorbis files. Their MIME type has a plus sign in them and gconf keys don't like plus signs.
Please post thoughts and feedback on this! :-)
http://img3.imagebanana.com/img/05lji7bf/Screenshot.png
Yup, it generates thumbnails from your audio files (mp3 and flac to be precise).
The magic is done through extracting three seconds of audio data from the input file (starting from 00:10 because a lot of songs tend to have silence at the beginning).
So the files will have to have a minimum length of 13 seconds or they don't get a thumbnail.
The extraction is done using sox - a really wonderful tool for song editing - which also converts it to raw text data. This textual data is then trimmed and fed to gnuplot which produces the graph. The composite tool from the ImageMagick project then helps us to overlay an icon.
I'll attach a debian package to this post (it depends on sox, gnuplot and imagemagick). It's essentially just a bash script, so it should work on other architectures than i386, I guess.
Things you can customize:
If you know your way around gnuplot you can probably change the color of the graph (currently it's red) or tweak it otherwise. Please let me know what you're doing and show examples! :-)
You can replace the music note icon with any file you like (it's in /usr/share/audiothumb/overlay.png). Just try have it about the same size (or adjust the placement options in /usr/bin/audiothumb [line 12]).
Things I can't figure out right now:
How to get rid of the frame/border that nautilus draws around every thumb. I imagine the thumbs would look nicer without them. Anyone know how to turn them off?
How to enable this for ogg vorbis files. Their MIME type has a plus sign in them and gconf keys don't like plus signs.
Please post thoughts and feedback on this! :-)