简体   繁体   中英

How do I set “Album Artist” of a song programmatically or through command line (linux)

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

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.

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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM