Retrieve replaygain tags

The place for "I can't figure out how to..." questions.
Post Reply
gPilgrim
User
Posts: 3
Joined: Tue Apr 12, 2016 7:49 am
Are you a spambot?: no

Retrieve replaygain tags

Post by gPilgrim » Tue Apr 12, 2016 8:01 am

Hi,
if the mp3 file has replaygain tags (id3V2), I wish to save these tags before deleting all other. So I can finally write the replaygain again in the tags.
Is there a tutorial or a summary about the description and accessing of replaygain tags via getid3?
Or is it possible to delete all other tags, without the replaygain tags?
Thanks for your help!

James Heinrich
getID3() v1 developer
Posts: 1424
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Retrieve replaygain tags

Post by James Heinrich » Tue Apr 12, 2016 3:33 pm

ReplayGain tags are more commonly applied in APE tags at the end of the file.
Wherever the data is originally stored the returned [replay_gain] key structure is the same (example).
You should be able to reconstruct your tag from there, or just write it to APE and not have to worry for any future modifications.

I'm fully aware that the tag-writing functionality in getID3 is very limited and not particularly friendly, it's considered alpha at best.

gPilgrim
User
Posts: 3
Joined: Tue Apr 12, 2016 7:49 am
Are you a spambot?: no

Re: Retrieve replaygain tags

Post by gPilgrim » Thu Apr 14, 2016 10:30 am

James Heinrich wrote:ReplayGain tags are more commonly applied in APE tags at the end of the file.
You should be able to reconstruct your tag from there, or just write it to APE and not have to worry for any future modifications.
I'm fully aware that the tag-writing functionality in getID3 is very limited and not particularly friendly, it's considered alpha at best.
OK, when I understand right, it's currently not possible to write mp3Gain data into id3v2.4 tags with getid3?

The background of my question is, that the "old" mp3gain lib isn't available in newer debian versions:
https://github.com/beetbox/beets/issues/1597

Therefore the recommended lib is replaygain (python-rgain). But this lib uses id3v2.4 instead of ape. So, I wish to change for all newer files to use mp3gain data in id3v2.

I use it in a little radio station:
https://github.com/srb-fm/admin-srb/blo ... _edits.php

James Heinrich
getID3() v1 developer
Posts: 1424
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Retrieve replaygain tags

Post by James Heinrich » Thu Apr 14, 2016 2:56 pm

It is possible to write ID3v2.4 replay gain tags (RGAD) using getID3.

You should first analyze the mp3 file with getID3, which will retrieve replay gain information from either ID3v2 or APE if present.
Look in the returned [replay_gain] array key to find all the replay gain information.
Then write the new ID3v2.4 tag.

gPilgrim
User
Posts: 3
Joined: Tue Apr 12, 2016 7:49 am
Are you a spambot?: no

Re: Retrieve replaygain tags

Post by gPilgrim » Mon Apr 18, 2016 7:49 am

James Heinrich wrote:It is possible to write ID3v2.4 replay gain tags (RGAD) using getID3.
OK,
I've searched in this php-file for terms like "replaygain_track_peak" and "replaygain_track_gain" but haven’t found it. Therefore I thought, it’s not possible...


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests