A primitive command-line ogg tag editor

I am still lacking for something that resembles an audio tag editor for the console, which may be my own oversight, or it may be that such an animal doesn’t exist.

In the mean time — the mean time until evolution produces one, or I discover that there has been one under my nose all this time — I have this exceedingly primitive substitute for editing the information in all the ogg files in a directory. I tried to squeeze it into one line, although I’m sure some of you professionals out there could condense it further.

for nam in *.ogg ; do vorbiscomment -l "$nam" -c "$nam".txt ; vim "$nam".txt ; vorbiscomment -w "$nam" -c "$nam".txt ; rm "$nam".txt ; done

You can substitute vim for whatever editor you prefer; the loop will skip through all the ogg files in a directory, allow you to edit their comment fields as you like, then write your changes back to the original file. The loop removes its text output, although you could trim that part in case you want to save it as a backup measure.

Next stop is to figure out how to read the fields and rename the file to a certain pattern. Hmm. … 😐

8 thoughts on “A primitive command-line ogg tag editor

  1. Simon

    I really like lltag, it has a simple design, can easily be scripted and has all the features you should need.

    I use this “script” to tag my music (after I encoded it with cdparanoia and oggenc). The music is stored in a directory named ‘Artist@Album@Year’.

    # Tag artist, album and disk number.
    lltag -F ‘%a@%A@%d/track%n%i’ –yes “$1″/*.ogg
    # Edit tags to add song titles (and other things if necessary).
    lltag -E “$1″/*.ogg
    # Rename the files.
    lltag –no-tagging –rename ‘%a/%A/%n %t’ –yes “$1″/*.ogg

    Reply
  2. Mick

    I’ve been working on such a command-line tagger:
    http://github.com/kchmck/braaainz

    It’s definitely alpha-quality but it gets the job done. If you run “braaainz tag –edit/-e *.ogg”, your text editor will open to edit each file’s tags. Otherwise, the “-s/–set” option can be used multiple times to modify tags un-interactively.

    Note that braaainz can be used without musicbrainz but still requires the python-musicbrainz2 library for now.

    I’ve actually been working on a such a renamer too:
    http://github.com/kchmck/nomen

    I don’t even have a readme written for it yet but for your purposes, you’d use something similar to “nomen rename ‘{audio[tracknumber]}. {audio[title]}’ *.ogg –preview”.

    Please let me know if you have any questions or ideas!

    Reply
  3. Pingback: Links 15/2/2010: Mobile World Congress: | Boycott Novell

  4. Pingback: A console goodie grab bag « Motho ke motho ka botho

  5. Pingback: Still searching for … « Motho ke motho ka botho

  6. Pingback: Is this a dagger which I see before me? « Motho ke motho ka botho

Leave a comment