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

  2. Mick

    I’ve been working on such a command-line tagger:

    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:

    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!

  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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s