9

There are various command line tools available for editing metadata of audio files. But none of them can edit "Album artist" tag of the audio file. Is there any command line tool or perl module to do the same ? Thanks

kaiz.net
  • 1,984
  • 3
  • 23
  • 31
mac
  • 627
  • 1
  • 9
  • 21
  • 1
    What kind of tag are you updating? ID3? Tablib can write to many. – Brad Apr 25 '12 at 20:16
  • Yes, it is ID3V2 (ID3v2.3) . Third tag mentioned here - http://help.mp3tag.de/main_tags.html . – mac Apr 25 '12 at 20:19
  • Found the answer here - http://stackoverflow.com/questions/5922622/whats-this-album-artist-tag-itunes-uses-any-way-to-set-it-using-java – mac Apr 25 '12 at 20:37

2 Answers2

5

mid3v2 comes with the mutagen library and is the best command-line tool for this purpose that I know of. When called with the -f argument, the TPE2 tag is listed as supported.

daxim
  • 39,270
  • 4
  • 65
  • 132
  • Specifically, setting the album artist can be done with, e.g. `mid3v2 --TPE2 "Fiona Ann Artist" *.mp3`. `mid3v2` has no shorthand for `TPE2`, so using the long option. – neingeist Jul 09 '22 at 16:11
3

MP3::Tag support it.

#!/usr/bin/perl

use MP3::Tag;

$mp3 = MP3::Tag->new($filename);
$mp3->new_tag("ID3v2");
$mp3->{ID3v2}->add_frame("TALB", "Album title");
$mp3->{ID3v2}->add_frame("TPE2", "Album artist");
$mp3->{ID3v2}->write_tag;
$mp3->close();

or

#!/usr/bin/perl

use MP3::Tag;

$mp3 = MP3::Tag->new($filename);
$mp3->select_id3v2_frame_by_descr('TPE2', 'album artist'); # Edit in memory
$mp3->update_tags(); # commit
$mp3->close();
askovpen
  • 2,438
  • 22
  • 37
  • 1
    Just for info of new users - First code will create a new ID3V2 tag (so it might delete the previous tag in the file) and the second code will just update frame of an existing ID3V2 tag. – mac Apr 26 '12 at 17:54