Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: ID3 Tags (Read 3143 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

ID3 Tags

Hi all ... first post here.

I'm new to all this audio stuff, but not new to computers.

I've just ripped all of my cd's, whilst being connected to tinternet, and all the tags (title, genre, etc) have been updated automatically, which is nice.

I was using a resizer program to compress these files, but the trial period has run out. A little bit of investigation has shown me that the program used Lame. I've been playing around with Lame on a DOS command line and I can succesfully compress ripped MP3 files to 25% of the original size. My problem is that Lame doesn't seem to transfer the tags to the compressed files, making the files useless in my MP3 player (A Zen Sleek, 20GB).

The DOS command > lame -b 40 "01 Time After Time.mp3" test1.mp3 ... compresses the file to the size and quality that I want.

lame --tt "%t" -b 40 "01 Time After Time.mp3" test1.mp3 compresses the file and puts the letter 't' in the title. This is NOT what i wanted !!

Does anybody know what command line instruction I should use to correctly transfer genre, album, artist and track title from the source file to the compressed file as I do the compression?

It's my ultimate aim to write some perl scripts which generate batch files to compress each of the tracks on an album.

ID3 Tags

Reply #1
Lame does not read tags in MP3 files, it only looks at the audio data in them. What you want is one of the several excellent frontend programs to pass this information to Lame, or else figure out how to read the tags yourself from your perl script.

ID3 Tags

Reply #2
Thanks pdq, I was hoping that would NOT be the answer. I know I can use some of the front end programs, but I was trying to do it for myself, the hard way.

I don't think perl would be able to extract the tags ... although i'm going to have a look at perlmod right now. I think this could be a job for C. After Oracle, C is my second language, but sadly extracting tags from audio files is an area I know nothing about.

ID3 Tags

Reply #3
If you don't want this to become a complete quest for you, and would like to try a different path: use Foobar2000. It is a programmer's dream of media players, completely customizable. I know jack about programming but I use it to transcode into other formats, and it reads and replaces tags for me.

There is plenty of information here at Hydrogen on FB2K:
Foobar2000 Forums
Foobar2000 Wiki

[Edit: Malfunctioning links]
OP can't edit initial post when a solution is determined  :'-(

ID3 Tags

Reply #4
Thanks SamHain, I'll have a look at foobar2000. Having spent a lifetime programming I do relish a good quest, and in fact I have actually solved my problem.

The Perl language does in fact have an MP3::Tag module which allows you to extract all the metadata from an MP3 file. I wrote a Perl script which reads all the files in a directory (where the tracks of my ripped cd are) then builds a batch file (.bat) which calls lame for each of the album tracks, where it passes all the relevant metadata to the lame compression. I then just run the newly built batch file and all the tracks are compressed (and renamed slightly so as to keep the original)

one line of the batch file might be built thus (for Abba fans)

lame --ta "ABBA" --tl "Ring Ring" --ty "2005" --tg "Pop" --tt "Ring Ring" --tn "1" -b 48 "ring ring.mp3" "zzz48 ring ring.mp3"

All of that literal text having been extracted from the original MP3 file by the MP3::Tag module.

off in search of fresh quests now.

 

ID3 Tags

Reply #5
And since no one has yet mentioned it in this thread, lossy to lossy reencoding is generally not a good idea, but is OK in certain cases. In this case, since you are reencoding to a much lower bit rate (25% of original size) I doubt that you would do much better if you were starting with lossless files. Of course, don't delete the original high bitrate files.