One-potato, two-potato, delete!
August 11, 2009 10:32 PM Subscribe
Is there an 'independent' (i.e., using software on a Win-Vista PC) way to determine which music file is of better sound quality?
Whenever I go on one of my music library purges, I often encounter a situation where I have a song in, say, 192kbps MP3 format and 128kbps AAC format. Or, the same song in 3 or more different formats. Usually I end up going back and forth between the different 'versions' of the song, to see if one 'sounds' better -- i.e., clearer and more rich in sound definition. I've always wondered if there was a more precise way of comparing two copies of the same song, in different formats, to determine which one should sound better? Even if the sound difference to me is negligible, it would help me make a choice that would feel more informed, rather than randomly picking one and deleting it. Any thoughts, hivemind?
Whenever I go on one of my music library purges, I often encounter a situation where I have a song in, say, 192kbps MP3 format and 128kbps AAC format. Or, the same song in 3 or more different formats. Usually I end up going back and forth between the different 'versions' of the song, to see if one 'sounds' better -- i.e., clearer and more rich in sound definition. I've always wondered if there was a more precise way of comparing two copies of the same song, in different formats, to determine which one should sound better? Even if the sound difference to me is negligible, it would help me make a choice that would feel more informed, rather than randomly picking one and deleting it. Any thoughts, hivemind?
In a word: no.
Any time you say "better", you're making a subjective decision and must define your context. Is a Camaro better than a Corvette? Is Mozart better than Stravinsky? Depends to whom you're talking. Is a hammer better than a wrench? Is a laptop better than a legal pad? Depends on what you're doing with it.
"Better sound quality" is not only subjective, it's really difficultly subjective and entirely dependent on content. When I listen to most music, I mix down the treble because it hurts my ears. Except when I'm listening to organ music, when I flatten the mix and enjoy the huge range of the instrument. Rap music is often mixed with the understanding that the bass will be tweaked upward. So what's better is hardly well-defined.
However, you can analyze audio files. You can pull up the waveform and do all sorts of neat analyses in the time domain (the one you're used to). You can run a Fourier transform and do another set of analyses in the frequency domain. There's an awful lot you can say about a piece of audio based on computer analysis. But there's no transform of audio into the "betterness" domain.
If you could precisely define the sonic characteristics you value, you might be able to specify a heuristic to be applied to the audio. A professor I worked with actually worked on very similar stuff as his main side project. He'd been at it for years.
For your purposes, the closest I think you could come is a heuristic based on the file properties. You could write a program that prefers FLAC to AAC to MP3; high bitrate to low bitrate. But none of that is going to determine better sound quality. You could have a FLAC file with a hiss in the background; you could have a high bitrate MP3 where some other option was misconfigured during encoding.
posted by Netzapper at 1:30 AM on August 12, 2009 [1 favorite]
Any time you say "better", you're making a subjective decision and must define your context. Is a Camaro better than a Corvette? Is Mozart better than Stravinsky? Depends to whom you're talking. Is a hammer better than a wrench? Is a laptop better than a legal pad? Depends on what you're doing with it.
"Better sound quality" is not only subjective, it's really difficultly subjective and entirely dependent on content. When I listen to most music, I mix down the treble because it hurts my ears. Except when I'm listening to organ music, when I flatten the mix and enjoy the huge range of the instrument. Rap music is often mixed with the understanding that the bass will be tweaked upward. So what's better is hardly well-defined.
However, you can analyze audio files. You can pull up the waveform and do all sorts of neat analyses in the time domain (the one you're used to). You can run a Fourier transform and do another set of analyses in the frequency domain. There's an awful lot you can say about a piece of audio based on computer analysis. But there's no transform of audio into the "betterness" domain.
If you could precisely define the sonic characteristics you value, you might be able to specify a heuristic to be applied to the audio. A professor I worked with actually worked on very similar stuff as his main side project. He'd been at it for years.
For your purposes, the closest I think you could come is a heuristic based on the file properties. You could write a program that prefers FLAC to AAC to MP3; high bitrate to low bitrate. But none of that is going to determine better sound quality. You could have a FLAC file with a hiss in the background; you could have a high bitrate MP3 where some other option was misconfigured during encoding.
posted by Netzapper at 1:30 AM on August 12, 2009 [1 favorite]
Response by poster: Hmmm. I thought it was unlikely that this was achievable through software, but I wondered if there was an outside chance that if you could compare two different encodings of the same song in some way (e.g., in Audacity) there might be some way to generally identify a 'better' version (more range? Hopefully it's obvious I don't have any idea what I'm talking about, and can be forgiven for this).
posted by planetthoughtful at 1:36 AM on August 12, 2009
posted by planetthoughtful at 1:36 AM on August 12, 2009
Best answer: Double blind ABX test- it is very time consuming and you probably won't want to do it for all your tracks.
Personally, I would take 128kbit AAC over almost all MP3's, even up to 320kbit.
posted by wongcorgi at 1:48 AM on August 12, 2009
Personally, I would take 128kbit AAC over almost all MP3's, even up to 320kbit.
posted by wongcorgi at 1:48 AM on August 12, 2009
Well, there are a couple of different things to consider; namely, source and encoding. In other words: the recording may have been of low quality before it was put into a computer (this especially applies to live recordings) and therefore the source might be bad; and then the encoding, the actual transfer of the file into bits and bytes, can be of variable quality. Someone can take an awful source recording and make a terrific transfer of it, and it'll still be awful; likewise, you can take a perfect, high-fidelity source recording and encode it horribly, and you end up with a similarly fucked file.
The difference between an awful source recording and awful encoding is, of course, that you can tell at a glance whether the encoding is bad; you'd have to listen to know if the source is bad. So if you've got a lot of live recordings in your collection (like I do) you might find that what I'll say doesn't help much, unfortunately. I have a whole slew of Grateful Dead, for example, for which I have two or three different recordings of a show alongside each other. With those, I'm stuck; but you can really tell the difference between differing qualities of source, since they were recorded from different places in the room, or they went through ten generations of tape rather than a single soundboard recording.
If the difference is in encoding, then there are ways; it's really already under your nose, friend. All these companies will sound off and tell you that this compression format is better than that compression format, or that this container format is more suited than that container format, but to my ear, they are all the same, with a few small exceptions. aac is pretty much the same as mp3 - it's just a fork of the original format, so there's a lot of similarities. I don't like wmv on principle, but it's really just the same, too.
Think of it this way: first of all, there are two types of music files, raw and compressed; raw files are always in wav format. Of the compressed files, there are two kinds: lossless and lossy. The lossless ones - like ALAC, SHN, FLAC (which happens to be my favorite), TTA, APE, and a few others - are of higher quality but larger file size, whereas the lossy ones are smaller but are of worse file quality, and are the ones you're familiar with like wma, aac, mp3, and m4a. All of these last are commonly rated by bitrate, measured in kbps (kilobits per second) which you mention; that's just a measure of how many ones and zeros the computer records to describe each second of music in every song. Like I said, any of these formats is roughly as good as the others at recording the data; you can reliably judge the quality of a music file chiefly by its bitrate, especially when the bitrates get far enough apart.
All of this is my longhand way of saying: as long as the sources are of the same quality, a 192-kbps mp3 file will invariably be better than a 128-kbps aac file. (In fact, if I came across a 128-kbps file of any kind in my collection, I'd delete it and find another copy - but that's me, and I'm pretty selective, so...) You can pretty much always delete the file with a lower kbps as being of lower quality, especially if the difference is as large as the difference between 128 and 192 kbps. The best commonly-seen mp3s are 320 kbps.
There is one exception: the newly-popular VBR files, which is short for Variable Bitrate. It is what it sounds like: a VBR file varies the bitrate in relation to the information needed to encode any given second of music. A 320-kbps mp3 has to use all of those 320 kilobits for a second of dead silence just as much as it has to use those 320 kilobits for full-on orchestral noise; but a VBR file can save space by encoding that second of dead silence by encoding it at 128 kbps, since even John Cage won't likely know the difference. Now, obviously, a VBR file won't be quite the quality of a full 320 kbps file; but it can be sizeably smaller, and it can often be undistinguishable from the larger file. That's why VBR files have become so popular of late.
Long story short: delete the lower-bitrate files; if they're VBR of a higher caliber, say 160ish plus kbps, then keep them over anything less than a 320 kbps static file. That's usually the best way.
And in future, if you like high quality, use Exact Audio Copy for your encoding; it's pretty fantastic at that. Finally, the people who make the True Audio (TTA) lossless codec have a pretty neat little utility called Tau Analyzer that does something somewhat akin to what you want, although it's not the same thing; it's intended to analyze CDs and determine whether they came from good full wav files or from crappy 128-bit mp3s or some such. It only analyzes CDs, not music files, so it won't be helpful for you here; but if you ever buy a disc that you're worried might be burned pirate crap with low quality, well, that's your utility.
posted by koeselitz at 1:59 AM on August 12, 2009
The difference between an awful source recording and awful encoding is, of course, that you can tell at a glance whether the encoding is bad; you'd have to listen to know if the source is bad. So if you've got a lot of live recordings in your collection (like I do) you might find that what I'll say doesn't help much, unfortunately. I have a whole slew of Grateful Dead, for example, for which I have two or three different recordings of a show alongside each other. With those, I'm stuck; but you can really tell the difference between differing qualities of source, since they were recorded from different places in the room, or they went through ten generations of tape rather than a single soundboard recording.
If the difference is in encoding, then there are ways; it's really already under your nose, friend. All these companies will sound off and tell you that this compression format is better than that compression format, or that this container format is more suited than that container format, but to my ear, they are all the same, with a few small exceptions. aac is pretty much the same as mp3 - it's just a fork of the original format, so there's a lot of similarities. I don't like wmv on principle, but it's really just the same, too.
Think of it this way: first of all, there are two types of music files, raw and compressed; raw files are always in wav format. Of the compressed files, there are two kinds: lossless and lossy. The lossless ones - like ALAC, SHN, FLAC (which happens to be my favorite), TTA, APE, and a few others - are of higher quality but larger file size, whereas the lossy ones are smaller but are of worse file quality, and are the ones you're familiar with like wma, aac, mp3, and m4a. All of these last are commonly rated by bitrate, measured in kbps (kilobits per second) which you mention; that's just a measure of how many ones and zeros the computer records to describe each second of music in every song. Like I said, any of these formats is roughly as good as the others at recording the data; you can reliably judge the quality of a music file chiefly by its bitrate, especially when the bitrates get far enough apart.
All of this is my longhand way of saying: as long as the sources are of the same quality, a 192-kbps mp3 file will invariably be better than a 128-kbps aac file. (In fact, if I came across a 128-kbps file of any kind in my collection, I'd delete it and find another copy - but that's me, and I'm pretty selective, so...) You can pretty much always delete the file with a lower kbps as being of lower quality, especially if the difference is as large as the difference between 128 and 192 kbps. The best commonly-seen mp3s are 320 kbps.
There is one exception: the newly-popular VBR files, which is short for Variable Bitrate. It is what it sounds like: a VBR file varies the bitrate in relation to the information needed to encode any given second of music. A 320-kbps mp3 has to use all of those 320 kilobits for a second of dead silence just as much as it has to use those 320 kilobits for full-on orchestral noise; but a VBR file can save space by encoding that second of dead silence by encoding it at 128 kbps, since even John Cage won't likely know the difference. Now, obviously, a VBR file won't be quite the quality of a full 320 kbps file; but it can be sizeably smaller, and it can often be undistinguishable from the larger file. That's why VBR files have become so popular of late.
Long story short: delete the lower-bitrate files; if they're VBR of a higher caliber, say 160ish plus kbps, then keep them over anything less than a 320 kbps static file. That's usually the best way.
And in future, if you like high quality, use Exact Audio Copy for your encoding; it's pretty fantastic at that. Finally, the people who make the True Audio (TTA) lossless codec have a pretty neat little utility called Tau Analyzer that does something somewhat akin to what you want, although it's not the same thing; it's intended to analyze CDs and determine whether they came from good full wav files or from crappy 128-bit mp3s or some such. It only analyzes CDs, not music files, so it won't be helpful for you here; but if you ever buy a disc that you're worried might be burned pirate crap with low quality, well, that's your utility.
posted by koeselitz at 1:59 AM on August 12, 2009
wongcorgi: Personally, I would take 128kbit AAC over almost all MP3's, even up to 320kbit.
That would be because aac is mp3, or rather is the successor to the mp3 codec as part of the same MPEG-2/4 group. But it's a little nuts to say 128 kpbs aac is better than 320 kbps mp3, isn't it? I've never had that experience, and I'd like to hear a comparison of files.
Besides, if anybody's concerned about high quality, why go lossy at all? flac files have treated me fine for a long time now, and they're invariably better than mp3 or aac.
posted by koeselitz at 2:05 AM on August 12, 2009
That would be because aac is mp3, or rather is the successor to the mp3 codec as part of the same MPEG-2/4 group. But it's a little nuts to say 128 kpbs aac is better than 320 kbps mp3, isn't it? I've never had that experience, and I'd like to hear a comparison of files.
Besides, if anybody's concerned about high quality, why go lossy at all? flac files have treated me fine for a long time now, and they're invariably better than mp3 or aac.
posted by koeselitz at 2:05 AM on August 12, 2009
In my experience, assuming equally good rips from CD of the same song, the size of compressed files is a pretty good proxy for sound quality. Bigger file = better quality.
(This is pretty much a quick way of comparing bitrates, and should even tell you when a VBR file is better quality than a non-VBR file.)
posted by mmoncur at 2:06 AM on August 12, 2009
(This is pretty much a quick way of comparing bitrates, and should even tell you when a VBR file is better quality than a non-VBR file.)
posted by mmoncur at 2:06 AM on August 12, 2009
By the way, I want to say this: at the risk of seeming contentious, I disagree with NetZapper; I think that the quality of encoded audio is by definition something that's quantifiable.
I'm that insane audiophile dude who uses such huge files that his ipod only holds an album at a time. I've got a big stereo setup at home and a nice collection of vinyl; I know that there's a huge amount of unpredictable and undefinable there, a whole range of things that people prefer, from bass to treble, from dry to wet, et cetera. Audio is a pretty ethereal thing when it comes down.
But the second you encode audio, and especially after you've compressed it, you've entered a realm of exact numbers and measurements; in other words, you've entered a realm where fidelity can be measured. Again, as long as the source is the same (that is, if the source is a directly-presented cd) we have a standard against which future copies can be tested: that first wav file that came off the disc. Call me crazy, but it seems to me that it happens very quickly that this stops being a matter of taste; I don't know anybody with ears to hear (that I trust) who prefers the sound of a 92-kbps wma file to a 320-kbps aac file, though I'm sure they exist somewhere. It's a matter of getting the encoding as close to the source as possible. aac has thus far succeeded at this most, for a compressed lossy file format; but of course lossless files, while larger, are of higher fidelity to the wav file.
posted by koeselitz at 2:15 AM on August 12, 2009
I'm that insane audiophile dude who uses such huge files that his ipod only holds an album at a time. I've got a big stereo setup at home and a nice collection of vinyl; I know that there's a huge amount of unpredictable and undefinable there, a whole range of things that people prefer, from bass to treble, from dry to wet, et cetera. Audio is a pretty ethereal thing when it comes down.
But the second you encode audio, and especially after you've compressed it, you've entered a realm of exact numbers and measurements; in other words, you've entered a realm where fidelity can be measured. Again, as long as the source is the same (that is, if the source is a directly-presented cd) we have a standard against which future copies can be tested: that first wav file that came off the disc. Call me crazy, but it seems to me that it happens very quickly that this stops being a matter of taste; I don't know anybody with ears to hear (that I trust) who prefers the sound of a 92-kbps wma file to a 320-kbps aac file, though I'm sure they exist somewhere. It's a matter of getting the encoding as close to the source as possible. aac has thus far succeeded at this most, for a compressed lossy file format; but of course lossless files, while larger, are of higher fidelity to the wav file.
posted by koeselitz at 2:15 AM on August 12, 2009
It's a matter of getting the encoding as close to the source as possible.
No, it's not - a large part of modern audio compression is about removing or at least partially ignoring elements a human listener cannot hear, which isn't the same thing as getting an output as close as the original digitized waveform as possible. The algorithms all assume that there's a human in the loop.
The same applies to modern image and video compression, of course.
lossless files, while larger, are of higher fidelity to the wav file
No need to use comparative adjectives here - if the lossless files don't have exactly the same content as the source (no matter what format that was stored in), you don't have lossless encoding.
(And as for MP3 vs AAC, the former is the audio layer from the MPEG-1 and MPEG-2 video standards, the latter the audio layer from the MPEG-4 standard. It's not the same encoding, even if there are plenty of conceptual similarities, and the differences at low bit rates can be quite huge.)
posted by effbot at 3:28 AM on August 12, 2009 [1 favorite]
No, it's not - a large part of modern audio compression is about removing or at least partially ignoring elements a human listener cannot hear, which isn't the same thing as getting an output as close as the original digitized waveform as possible. The algorithms all assume that there's a human in the loop.
The same applies to modern image and video compression, of course.
lossless files, while larger, are of higher fidelity to the wav file
No need to use comparative adjectives here - if the lossless files don't have exactly the same content as the source (no matter what format that was stored in), you don't have lossless encoding.
(And as for MP3 vs AAC, the former is the audio layer from the MPEG-1 and MPEG-2 video standards, the latter the audio layer from the MPEG-4 standard. It's not the same encoding, even if there are plenty of conceptual similarities, and the differences at low bit rates can be quite huge.)
posted by effbot at 3:28 AM on August 12, 2009 [1 favorite]
If you have the "original" from which the compressed files were created, then you can use the mathematical measure PSNR. However, the relationship between PSNR and perceptual quality -- particularly across codecs -- is rather tenuous, and you may not have access to "originals" (e.g., the 44.1kHz, stereo, 16-bits-per-channel CD or a lossless version of it) even if you wanted to perform this computation.
posted by jepler at 5:16 AM on August 12, 2009
posted by jepler at 5:16 AM on August 12, 2009
Response by poster: Thanks all, I've been experimenting with the ABX test as suggested by wongcorgi, and this seems to be the best I'm going to achieve. As wongcorgi says, it is labour-intensive, but not much more so than what I was already going through with simply going back and forth between two tracks multiple times. I'm using the ABX addon for foobar2000, to determine that I can predictably detect a difference between the tracks, and then making a judgement call on which I prefer. If anyone else has any other suggestions -- particularly but not limited to if there's an ABX utility out there which will also randomly test 'preference' -- I'd appreciate hearing them.
posted by planetthoughtful at 7:33 PM on August 12, 2009
posted by planetthoughtful at 7:33 PM on August 12, 2009
This thread is closed to new comments.
posted by delmoi at 12:55 AM on August 12, 2009