On Thu, Aug 27, 2015 at 10:00:54PM +0100, Neil Bothwick wrote
> On Thu, 27 Aug 2015 15:42:46 -0400, Walter Dnes wrote:
> 
> >   Title-artist-based filenames are harder than it looks.  I'm working on
> > a bash script to generate title_-_artist.flac filenames from
> > audio_nn.inf data.  Then I'll pass that name to flac's "-o" parameter.
> 
> Why reinvent the wheel? abcde is a shell script that does this and much
> more. It uses whichever ripper, encoder etc. that you want, with whatever
> options you want.

  I like to putter around with bash scripts.  I've written up a 146-line
script (83 lines of script plus 63 lines of comments) that handles
things to *MY* specs for *MY* needs.  It processes .inf and .wav files
in a directory, creating flac files in a flac subdirectory.  I haven't
tested it under all conditions, but it tries to handle...

* Check for a "flac" subdirectory; create one if it doesn't already exist
* If "Tracktitle" field is empty, bail out.
* If "Tracktitle" field contains a slash ("/"), assume that the artist's
  name is to the left of the slash, and the song name is on the right
  side of the slash.
* If "Tracktitle" field is non-empty, but doesn't contain a "/", assume
  that it only has the title.
  - Get the artist name from the "Performer" field.
  - If "Performer" field is empty, use "Albumperformer" field.
  - If both are empty, set artist name to "Unknown".
* The flac files are created in the "flac" subdirectory

-- 
Walter Dnes <waltd...@waltdnes.org>
I don't run "desktop environments"; I run useful applications

Reply via email to