Tag Archives: YACLP

shn>mp3 from the command line

flickr photo shared by sickmouthy under a Creative Commons ( BY-NC ) license

YACLP—Yet Another Command-Line Post: this time, it’s how to convert Shorten files (an obsolete lossless audio codec) to mp3 for portable listening. Most of the time, I use SoundConverter to transcode from lossless formats to mp3 for portable listening. For some reason, however, SoundConverter can’t find Shorten, even though I have it installed. I suppose if I knew where it was looking, I could put in a symlink to where it really is. Or I can just dig up something that works from the command line. Thanks to this handy thread by shantiq from UbuntuForums, here’s one command that will convert a whole directory full of shn files. Just cd to the directory holding your shn files and do the following:
for f in *.shn; do ffmpeg -i "$f" -ab 320k "${f%.shn}.mp3"; done
If you really want to do it shipshape and Bristol-fashion, you could use shntool to convert to flac and tag the files with appropriate metadata and then use SoundConverter to go to mp3, preserving the tags from flac:
shntool conv -o flac *.shn
For tagging, renaming, and adding track numbers, I’m a big fan of Ex Falso, and for an audio player, I like DeadBeef for its simplicity.