Archive for the ‘cue’ Category

Debian GNU/Linux: Split Lossless Audio with Cue

May 1, 2012

I wanted the simplest possible way to split cue+lossless into individual flacs, all named and tagged from the cue file.  There are some good scripts out there but I really don’t want to have to remember anything at all in terms of options and I don’t want any output format other than flac.  I’ve written a small script that does exactly what I want.

It detects cue sheet character encoding and if it’s anything other than UTF-8 it automatically writes a new UTF-8 cue sheet so that the final file names and tags retain their diacritic marks and non-Latin characters.

It discards unwanted pregap output.

It works well with find so it’s easy to use it recursively and/or for multiple cue+lossless files.  It works equally well as a file manager context menu entry and will run fine without needing a terminal.  This is a nice feature for Thunar custom actions.

It doesn’t modify, overwrite or delete existing files.

It works with any lossless file supported by shntool, which means just about anything.

It’s short  and simple so easily modified if desired.

This is a happy feeling non-judgemental script:  there are no options or settings or configuration files so if it doesn’t work it probably isn’t your fault, leaving you free to relax and move onto doing something else.

It’s as easy to use as `cue2flacs my_cuesheet.cue`

or

`find <path> -iname “*.cue” -execdir cue2flacs “{}” \+`

or

`for i in *.cue ; do cue2flacs “$i” ; done`

http://pastebin.com/NFQxEtug

edit:  an improved version of this script is at http://pastebin.com/pL63AQSr

The improvement is in detection of character encoding which is vastly better now due to using python-chardet, so writing a new utf8 cue sheet should work every time now.


		
Advertisements