Showing posts with label audio file tags. Show all posts
Showing posts with label audio file tags. Show all posts

Wednesday, August 25, 2010

Tagging audio files using Music Brainz Picard- Some more examples

Here are some more screen shots to illustrate identifying music files by use of an acoustic fingerprint, and adding tag information, using Music Brainz Picard.
I've added a folder containing 19 music files which are not tagged with meta-information- album, artist, track etc.- and used the scan button to have Music Brainz Picard check the acoustic fingerprints of the tracks against its database. The application has suggested four possible album matches:


The first suggestion is actually the album I'd ripped to MP3.


The complete green bars indicate a match with high confidence; the incomplete green bars a slightly less confident match, and the incomplete orange bar (track 16) a tentative match. (As we saw in the previous post, matches with low confidence are shown by a red bar.)
There are three tracks (5, 15 & 19) for which the application has not found a matching file. If we select this album and save, the corresponding files will not have their tag information added. We need to tell the application that three of our files in the added folder correspond with these tracks- we'll either find them in the unmatched files, or in the three other album suggestions.
In this case, my unidentified album was a soundtrack, which included tracks originally found on other albums, so it won't be surprising if Music Brainz Picard thinks they belong on another CD.
Here is our missing track 19, track 18 on another CD: we need to drag and drop it to track 19 on the first CD suggestion.


Here is our missing track 5: again we need to drag and drop it onto track 5 in the first CD suggestion.


And here is our missing track 15: drag and drop to the first CD suggestion as before.


In this example, Music Brainz Picard had correctly identified all the tracks, but understandably not been able to tell which CD the tracks were from.
It's also possible to see the acoustic identification completely misidentify a track, it which case it's again necessary to manually drag the misidentified file to the correct CD suggestion, and drop it on the correct track number.
(If there is a way to tell Music Brainz Picard "this suggestion is the correct album, and all my files belong to that album, in the order that they appear as files in the folder", then I haven't found it. If anybody knows better, or can simply or clarify the instructions given, please leave a comment.
Update: Forgot to RTFM.
You can drag whole directories, multiple files or album clusters onto albums and Picard will attempt to match the dragged files to the album. Any track that doesn't match up well enough, will be added to an "Unmatched Files" sub-folder specific to that album. You can drag files out of this folder and into the right slots in the album to fix up the files that Picard couldn't get right.

Tuesday, August 24, 2010

Tagging audio files using Music Brainz Picard

As described in the previous post, I recently converted some audio files from the FLAC format to MP3 using Sound Converter. Now sound converter is very clever, and when it converts files with no tags, it goes online to look for the appropriate information: album, artist, title etc. As far as I can work out, (see a previous post), it does this using a discid calculated from track lengths and an online database of CD discid's.
For several of my CD folders, Sound Converter correctly added MP3 tag information (although it left the files without meaningful filenames). Other folder it could not identify, and I had to use a different system of file identification, an acoustic fingerprint, and a different application Music Brainz Picard (which can also take care of the file name issue, renaming files according to the track name*).
It took me a while previously to work out how to use Music Brainz Picard, and when I cam to use it again, I realised I forgotten what I'd learnt, so I thought I'd write a short tutorial.
The first step is to add a folder containing tracks you want to identify from the menu.


The unidentified tracks should appear as unmatched files.


[Update: Anonymous has commented that it would be more efficient to use the Cluster and Lookup features here first- see comment for details.]
I can then select the unmatched files and use the Scan option from the menu, which will create an acoustic fingerprint and check it against the Music Brainz database. Suggested matches will appear in the right-hand window. In this case, there are only two hits- the red bars show that the confidence in a match is low, but the result is correct.

In the case of a more certain match, the bars will be green. If the track appears on more than one album, or the acoustic fingerprint created matches more than one track, alternative album or track suggestions will be displayed.
This is where some manual work comes in- I have to drag the unmatched file to the appropriate track (on the appropriate album, if applicable). (In the case of mismatched files, I have to drag those from the wrongly suggested album to the correct album.)
[Update: From reading the Music Brainz Picard documentation, it seems I can drag all of my unmatched files and drop them on the identified album, and Music Brainz Picard will attempt to sort them out.]
Note: If I click Save above, Music Brainz Picard will only add tag information for two tracks in the folder. I have to do some dragging and dropping:

Now I have matched all the tracks, I can click Save.

The correct tags have been appended to my files. (To change the file names to something more meaningful, select Options>Rename Files.)
In the event that acoustic fingerprinting can't suggest an album match, enter album, artist or track details and click the search icon. This will open a web page in your default browser. Check the suggested hits and click the green Tagger button to return details to Music Brainz Picard.

* To change file names to match tag information, select a folder and use the Lookup button to match tag information against Music Brainz Picard's database, select Options>Rename Files and save.)
Update: More example screen shots in this post.

Monday, June 28, 2010

Rip CD's to MP3 in Debian

[Update 27/10/2012: this  information was written for Squeeze over a year ago, but the situation in Wheezy is very different. Wheezy will of course become the stable release in a few months, so bear this in mind when reading.]

My portable music player only plays MP3 and WMA format files, so I rip CD's into MP3. I hadn't ripped a CD since installing Debian, so coming across this post on the Debian forum, I checked and found that MP3 in Audio CD Extractor was not enabled. Following the instructions in the post, I was able to enable ripping into MP3.
For various legal reasons (Zzzz*) Debian doesn't come with the ability to rip CD's to MP3. The issue is discussed on the Debian forum (before drifting off into a more interesting discussion of football). Ripping CD's requires an encoder. LAME is the MP3 encoder used by Debian, and gstreamer0.10-lame is the package required. It can be installed by adding the Debian Multimedia repository.

*Here's the legal stuff, as far as I can work it out.

An MP3 encoder can be downloaded for personal use.
...no license is needed for private, non-commercial activities (e.g., home-entertainment, receiving broadcasts and creating a personal music library), not generating revenue or other consideration of any kind or for entities with associated annual gross revenue less than US$ 100 000.00. mp3licensing.com
The legal stipulation here is that it can only be distributed in countries not covered by software patents.
Distributing compiled binaries of LAME, its libraries, or programs which are derivative works of LAME in countries which recognize those patents, may be considered infringing on the relevant patents. Wikipedia.org
But this does not affect the end-user, because it is the responsibility of the distributor to comply with local laws.

The legality of ripping CD's varies from country to country.
In the United Kingdom, making a private copy of copyrighted media without the copyright owner's consent is illegal: this includes ripping music from a CD to a computer or digital music player. The UK government has made proposals to allow people to make copies of music for personal use. According to one survey, 55% of British consumers believed ripping a CD to be legal, and 59% admitted to doing it. Wikipedia
(Cough.)

Tuesday, January 12, 2010

Free as in Freedom or Free as in Beer?

I now have a stable operating system running only free software (free as in freedom) running on my old Compaq (see below). If it were a person, it's feet would be two inches off the ground.
But can I listen to MP3's, watch video clips on the BBC or YouTube or watch DVD's? That will require some non-free software (as in freedom, but still free as in beer). It will also leave the computer distinctly earth-bound and not in its previous extramundane state.
MP3's were easy. Just a case of installing libxine1-ffmpeg.
Flash required a bit more effort. I had to add a repository for lenny-backports ( "Be warned : The resulting system can't be considered plain "stable" anymore"). If, like me, you're wondering what backports are, the Debian Wiki has an explanation.
DVD's also required adding a repository- this time debian-multimedia. After installing libdvdcss, and inserting a DVD, Totem popped up and auto-played it, but only the first chapter- the copyright notice and introductory screen. I installed MPlayer but that had the same problem. A quick Google suggested that this is a common problem in Debian- the support for DVD menus isn't there (both Totem and MPlayer can display DVD menus in Ubuntu). One media player that can handle DVD menus in Debian is gxine. Information on installation is in the link above.
After adding the debian-multimedia repository and checking Update Manager, there was a warning about "new dependencies for some new applications or newer versions of existing dependencies" and an option for a "smart upgrade". (As described here.) I took the option for a smart upgrade and it seemed to work out all right, but still, what was all that about?
In short, enabling the proprietary/non-free/possibly illegal packages which a lot of people (including me) use without much thought is trickier on Debian than on Ubuntu. Even on Ubuntu, it can be daunting if you're using Linux for the first time, or don't have much computer experience. I can see why distros like Mint are popular.
My experience with Debian was made more difficult than it needed to be because there was no multimedia installation page provided by Debian to refer to- I had to get information from a lot of different pages, many of them blogs or Linux resources rather than Debian pages. It something that Debian seems to be working on, which is good to know.
The feet of all Linux users do not hover two inches above the ground through purity and holiness.

Monday, October 12, 2009

Linux MP3 tag editors- a review

The story so far. In the beginning, the universe was created...
OK, skip that bit. I have a collection of MP3 files, and the tags attached to some of the files are causing errors in the way albums are displayed in some music players. I want to view and edit MP3 tags. My last post on the subject ended with some confusion as to which tag editors can do what, so here is a quick review.


Kid3 is the clear winner in KDE. (It's perfectly usable in Gnome- but the KDE dependencies make it a little slow to load, and it uses the KDE theme.) The Gnome alternative, Audio Tag Tool, produces errors when reading ID3v2 Version 2.3 tags, and cannot read ID3v2 Version 2.4 tags- the default used by such applications as Sound Juicer.
Applications using the Mutagen backend are a very usable alternative in Gnome, only lacking the ability to see which ID3 standard is being used, and if an ID3v2 tag exists, to see which version, and to switch view between tag standards if both exist.
UPDATE: A comment points out that there is a version of Kid3 for Gnome (kid3-qt) which doesn't have the KDE dependencies- a tip of the hat there.

Thursday, October 8, 2009

Music file tags

Rip a CD and the ripping program will often go online and look up the album, artist and track information, and append this information to the audio file as a tag. Sound Juicer does this in Ubuntu. But how does it work, and is it possible to automatically tag audio files that have been ripped without tagging? This issue caused me some confusion recently.
I used Audiograbber to rip some CD's into MP3 on a Windows computer. The program didn't prompt me to add the tag information, so I assumed it didn't have this facility (looking at the website now, I see it does). The result was several folders of MP3 files with no meaningful file names or tag information.
I decided to look for a way to automatically tag and name the files. I found EasyTAG. The program gave me an option to search the something called the CDDB database to look up the CD details. For several of my folders of MP3's, this worked. For one folder, the program found the CD in the database, but one track didn't match up. In frustration, I tried MP3Tag in Windows. Using the same CDDB database (freedb.org) and entry, the program correctly tagged the folder. (Ho hum.)
But I was left in some confusion. Apart from not seeing that I could have used Audiograbber to look up the files when I ripped them, I hadn't really understood what how EasyTAG and MP3Tag found the metadata for my files, as this post to the Ubuntu Forum proves.
So how does CDDB work? Wikipedia has a good explanation. The CDDB database uses a "discid" created from track duration information stored in the table-of-contents of the CD.
So how had EasyTAG recognised my already-ripped MP3 files without a table-of-contents? I'd assumed it must have used an "audio fingerprint", but I was obviously wrong. I can only guess that EasyTAG and MP3Tag use track length information to create a discid.
So is there a way to identify audio files using an "acoustic fingerprint"? Yes, MusicBrainz Picard can do it in Linux. (Winamp in Windows uses Gracenote.)

Tuesday, October 6, 2009

Audio file tags- and problems therewith

Audio files like MP3 files can contain metadata (information about the information) in a "tag" (an appendage to the file.). That's why when a music player plays a music file, it can show the album, artist and track information even if the folder and file names do not carry this information. Of course, if there is no metadata, a music player will not show album, artist and track information, even if the folder and files do carry this information.
Ripping a CD to MP3 will result in files that play as "Track 1, Unknown Album, Unknown Artist" or similar- unless the ripping program is capable of looking up these details and appending them to the MP3 file. (See a later post.)
A problem can arise if music tracks are incorrectly tagged, because music players use the tags (not folder and file names) to organise a library. So a stray space or upper case letter in the wrong place in a track or artist title can mean an album appears twice in a music library.
Some music players are better at dealing with minor errors like this and will group tracks and albums correctly even if there are minor differences in tags. Winamp in Windows is pretty good in this respect; music players in Gnome seem to be more fussy. (Amarok is as good or better than Winamp, but it's a KDE application- usable in Gnome, but slow to load and a different theme.)
A error in the way a music player organises tracks and albums in a music library means looking at the file tags for errors. Here's where the fun starts. There are two different standards for tagging MP3 files, and several different versions of the second standard. (Wikipedia has a good write-up.) How to view and edit tag information?
My music collection is on a Windows partition, and I've always used Winamp for tag editing, but recently I had a problem with an MP3 file tag causing problems, so I thought I'd try some Gnome alternatives. Amarok has excellent tag editing, but, as I've mentioned before, it's a KDE application- usable, but not ideal in Gnome.)
I tried Rhythmbox and Banshee (two music players with tag editors) but couldn't see the problem. I also tried a couple of tag editors- Audio Tag Tool and EasyTAG. I booted into Windows and looked at the album with Winamp: the problem was obvious in Winamp's excellent tag editor: a superfluous "Album Artist" compilation ID3V2 tag was causing a music player to mis-identify an album as a compilation. ("The Pot" in this screenshot.)


The tag didn't show up in EasyTAG:

Going back to Audio Tag Tool and clicking the "Advanced" button, I was able to see the offending tag, this time in a field called "Band".

Deleting the "Album Artist" tag in Winamp allowed the music player to list the album correctly, but curiously left Audio Tag Tool unable to view any of the ID3V2 tags.

This illustrates another problem: there are different versions of the ID3V2 standard, and tags written in one version may not be readable in another.
I later came across Kid3, a KDE tag editor, which listed the "Album Artist" tag correctly: in fact, as clearly as Winamp.

The problem with Kid3 on Gnome is it requires a lot of KDE dependencies, and uses the KDE theme. Not show-stoppers, but a good Gnome application would have been nice.
UPDATE: A comment to a subsequent post points out that kid3-qt is available in Gnome without the KDE dependencies.
Verdict: If you want to edit tags in Linux, KDE has the best applications: Amarok and Kid3.
In Gnome, there is nothing which will view and edit all standards and versions of MP3 tag accurately and without errors. Or if there is, I haven't found it.
UPDATE: Maybe I have! It's called Mutagen: it's used by several Gnome programs to edit MP3. Here's a couple of examples of programs which use it, and how they found the error described in the post.
The first is the Edit>Details screen of MusicBrainz Picard.

Next we have Ex Falso.


Exaile, which also uses the Mutagen backend, also displayed the "Album Artist" tag correctly.
I'm not sure why Ex Falso labelled the tag as "Performer" rather than "Album Artist", but I think it's an issue with the ID3V2 standard.
Mutagen can read all versions of the ID3V2 standard.
UPDATE 2: Mutagen doesn't appear to recognise ID3V1 tags: trying out Quod Libet and Exaile, I found that tracks tagged only in ID3V1 are listed as "unrecognised".
UPDATE 3: Even if the above players can't recognise tracks on the basis of ID3v1 information, Mutagen based tag editors have no problem doing so see this test.