Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to be mean to audiophile friends that claim they can tell MP3 compression artifacts by listening. I'd like to create a bunch of MP3s (or other files) based on the same source track to have them try and rate the quality of each; to make this more difficult, it would be best if it the file sizes were the same.

Is it possible to pad an MP3 with dummy data to a desired constant (-ish) length, or any other way to prevent "cheating" like this?

share|improve this question
Hi, Why would that be useful from a methodological POV? If you let your friends have the files, they can look at the compression rate anyway, and if you have them just listen to the songs, they will not be able to see any file data including size. Also, arguing with audiophiles is usually a lost cause (a bit like conspiracy theorists); they would probably tell you that the padding bits somehow enhanced the sound or something. – Rom1 Aug 18 '12 at 10:52
@Rom1 I'm assuming good faith to begin with. Music players don't display the bitrate by default, while file managers usually do show file sizes. I'm not trying to foil someone determined to cheat, but to make it easier to not cheat inadvertently. – millimoose Aug 18 '12 at 13:00
@Rom1 Also, my motivation here isn't really to Be Right, but to throw them for a bit. Creative excuses to chuckle at wouldn't be a bad payoff to this. – millimoose Aug 18 '12 at 13:03
up vote 4 down vote accepted

Just padding the file to a desired length is easy. The example below creates a file with the right size and adds it to the end of a song. Note that this will not change the mp3 itself and that many programs will display additional data (e.g. VBR 320). This will not be changed and your friends can still 'cheat' by looking at that.

 [hennes@mud ~/testdir]$ ls -l
 total 2996
 -rw-r--r--  1 hennes  users  3058207 Aug 18 12:58 song.mp3

How much padding do I need ?

 [hennes@mud ~/testdir]$ calc 5000000-3058207

Create a file with 1941793 zeros

 [hennes@mud ~/testdir]$ dd if=/dev/zero of=Padding_file bs=1 count=1941793
 1941793+0 records in
 1941793+0 records out
 1941793 bytes transferred in 10.502867 secs (184882 bytes/sec)

Check the result.

 [hennes@mud ~/testdir]$ ls -l
 total 4900
 -rw-r-----  1 hennes  users  1941793 Aug 18 13:00 Padding_file
 -rw-r--r--  1 hennes  users  3058207 Aug 18 12:58 song.mp3

Concatenate the files (in windows copy /b should do the same)

 [hennes@mud ~/testdir]$ cat song.mp3 Padding_file > padded_song.mp3

 [hennes@mud ~/testdir]$ ls -l
 total 9796
 -rw-r-----  1 hennes  users  1941793 Aug 18 13:00 Padding_file
 -rw-r-----  1 hennes  users  5000000 Aug 18 13:01 padded_song.mp3
 -rw-r--r--  1 hennes  users  3058207 Aug 18 12:58 song.mp3
 [hennes@mud ~/testdir]$

Play the file as a final test. Adjust the size of the padding file as needed.

(Before someone comments: Yes, this is a bloody inefficient way of using dd)

share|improve this answer
I suppose if I wanted to obscure the bitrate I could just convert to FLAC and pad that if it's possible. – millimoose Aug 18 '12 at 13:04

If you're using Windows, you can use MP3packer to properly pad a low-bitrate MP3 to make it be a higher-bitrate MP3, with no change to the audio data. Bulking up an MP3 is the opposite of what the program is designed to do, but it's one of the program's capabilities. Thus you can perhaps take some terrible-sounding, low-bitrate MP3s and make them be terrible-sounding 320 kbps CBR MP3s. Make a whole set with different bitrates from one source; they'll think each MP3 is different but the audio data will be the same.

Blind testing would be better, though. Your friends shouldn't have any expectation about what they're hearing. Don't let them know the bitrate or anything. Decode the MP3s to WAV files and just use those. Consider using a loudness-level-matched ABX test harness, as provided in the foobar2000 media player.

Another way to make MP3s that confound your friends' expectations would be to use source material that is quieter, has nothing above 16 KHz, or that is mostly mono; this will generally compress much better and yield high quality at low bitrates. Some MP3 encoders allow you to modify the input in these ways, or they do it automatically depending on the other settings you choose.

Also consider that if 16 KHz+ white noise / tape hiss is preserved, some will notice, some won't, but you can't predict whether the ones who do notice will consider it to be just the noise that it is, or "brightness" and "increased clarity" in the music. They may consider such music to be "higher quality".

share|improve this answer

It's possible – almost all ID3v2 tags have some amount of padding to make metadata edits faster. (The padding size cannot usually be adjusted, however; only Mp3Diags has such an option.)

An easier way is to insert fake metadata in the ID3v2 tag – such as a dummy cover photo, garbage lyrics, or even arbitrary TXXX chunks which are not displayed by most tag editing software.

This can be easily defeated by stripping all ID3 tags, however.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.