Being an electronic music producer, file format is something I have to consider at some point. I usually export my songs as .wavs and then convert them to .mp3s later (since they are smaller than .wavs). But can someone tell me which is better concerning sound quality or other factors?
2 Answers
The executive summary of Charles' very detailed answer is:
- Use WAV for recording and editing.
- Use your audio editor's native file format with references to the WAV files to keep disk space under control
- use MP3 for distribution. 44.1 and 160kbps is lots, unless your audience has a home stereo that is worth more than their car and ears to match.
-
13320kbps is audibly better than 160kbps though. If I paid money for 160kbps I'd be less than pleased. Commented Oct 14, 2014 at 13:15
-
2
-
7It's important that mp3 is only suitable for private distribution as a destination format (off a personal website for example). Do not send mp3 to distribution or streaming services such as iTunes, Bandcamp, YouTube and SoundCloud. These services perform their own conversions and should not have compressed files as a source.– RadiodefCommented Oct 14, 2014 at 18:01
-
5I'm surprised no one has pointed this out yet, but mp3 is riddled with royalties that you might need to pay when you distribute them commercially. Be careful -> mp3licensing.com/help/developers.html#58– borrrdenCommented Oct 15, 2014 at 3:51
-
5Even on fairly low budget stereo systems (or computer speakers) I can hear a big difference between 160kbps and 192kbps. For production or distribution I wouldn't suggest using anything less than 192kbps MP3.– charlieCommented Nov 11, 2014 at 5:59
Wave is an uncompressed or lossless format, whereas MP3 is compressed or lossy. Technically .wav is just a container format and can hold various types of compressed or uncompressed audio, but typically you'll see it containing LPCM uncompressed audio (the same as on audio CDs). With .wav files, you are essentially getting a raw bitstream representation of the audio signal in digital form. An analog sound produced in the real world contains essentially an infinite amount of information because it is a wave that is constantly changing (see below). In order to bring these sounds into the digital domain you need to sample the signal at various intervals to make an approximation of the sound. For .wav the audio signal is usually sampled at 44,100 times per second or more, and each sampled value is recorded so the sound wave can be reproduced:
The analog sound wave is sampled at every T interval to make a digital approximation of the original signal. (For digital audio T is usually 1/44,100th of a second or less)
MP3s are compressed in order to squeeze the same audio information into a smaller file size. The .wav format is great for very faithful representations of the analog signal, but as you probably know that's usually at the cost of larger file sizes. Compressed audio (and video in a similar fashion) is designed to reduce the file size while still maintaining a respectable level of fidelity. In layman's terms, compression attempts to remove the unnecessary data from the stream and reduce the signal to its most necessary components. With MP3, the compression and encoding algorithms use a model of how we hear to analyze the audio in the frequency domain and remove any unnecessary information. For instance, due to auditory masking if there are two sounds at close frequencies, often we will only hear the louder one if the difference in volume between the two is significant. So for MP3, the lower volume sound could be discarded and the audio would sound essentially he same to our ears. More info on the technical side of MP3 encoding here.
In practice, both .wav and MP3 have their uses. For production, .wav is the standard because it will almost always be a 100% accurate, bit-for-bit reproduction of the source material. MP3s can be a decent alternative at high enough bitrates. The bitrate is the measure of how many bits per second the MP3 encoding will use, meaning the higher the bitrate, the closer the MP3 will be to the original, uncompressed stream. Bitrate is usually measured in kilobits per second (kbps). I like high audio quality for my digital music collection, so when I have the option I usually encode MP3s at a constant 256 or 320kbps. That is the higher end of what MP3s are capable of, and unfortunately a lot of digital music out there is not encoded that high. When the bitrate comes down, you can usually hear it first in the high frequencies, for example the cymbals from a drum kit will sound off. 160kbps is tolerable, but anything lower than that and you will really start to notice. But again, with a high enough bitrate the differences between MP3 and .wav are barely distinguishable, especially to an untrained listener (most listeners).
For .wav files we mostly look at bit depth and sample rate or frequency. Bit depth is the number of bits used to encode each sampled value. The sample rate tells how many times per second the audio is sampled. CD (.wav) and MP3 are encoded at 44,100 Hz sample rate (Hertz meaning "cycles per second"). Newer computers and audio hardware/software are now accommodating higher sample rates, including 48kHz or 96kHz. For .wav the bit depth is usually 16-bits or 24-bits on the newer systems. For most purposes, when using .wav, 16-bit and 44.1kHz is sufficient, but if you have the capabilities it's usually worth upgrading to 24-bit, 48kHz.
Some example file sizes for a stereo five minute recording:
- .wav, 16-bit, 44.1kHz: 50 MB
- .wav, 24-bit, 48kHz: 82 MB
- .wav, 24-bit, 96kHz: 164 MB
- MP3, 128kbps, 44.1kHz: 4.5 MB
- MP3, 192kbps, 44.1kHz: 7 MB
- MP3, 320kbps, 44.1kHz: 11 MB
- FLAC, 24-bit, 44.1kHz: 28 MB
- FLAC, 24-bit, 48kHz: 31 MB
- FLAC, 24-bit, 96kHz: 61 MB
There is also a variable bitrate option for MP3 encoding, which should offer slightly smaller file sizes for the same quality. It uses an encoding scheme that changes (varies) the bitrate for different portions of the song depending on complexity and how many samples would be needed to recreate a given section faithfully.
[Edit: FLAC] There is a third category as well: lossless compression. FLAC is a good example of this, and has the quality and fidelity of a .wav file but with smaller file sizes (still considerably larger than MP3 though). One downside of FLAC, especially in a production setting, is that not all software can play it. I use it for certain albums in my personal digital music collection where I want a more faithful reproduction than MP3. But for production I usually stick with .wav and MP3.
[TL;DR] I keep my samples and loops as .wav if I can help it, and usually encode my finished tracks to MP3 for distribution. If you have the option, go with .wav. But if there are space constraints or you only have an MP3 version of something, as long as it's a high enough bitrate (at least 256kpbs is ideal), most people can't tell the difference.
-
7Just to nitpick: WAV is a container format. It's mostly used with lossless LPCM, but sometimes it's used with lossy codecs — ADPCM, speech codecs, sometimes even MP3!– hobbsCommented Oct 14, 2014 at 3:18
-
2It may be worth to point out that there are also lossless codecs which can save some disk space without losing anything in quality (FLAC comes to mind - typically it reduces the file size of ~50%). Commented Oct 14, 2014 at 6:52
-
2It's also interesting to note that the 44100 sample frequency is a result of en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem Commented Oct 14, 2014 at 7:55
-
5note that (un)compress and loss(y/less) doesn't relate to each other. An uncompressed format may well have lossy quality because the quality reduction appears before compression. Conversely compressed formats like FLAC retain the original quality, so they're lossless– phuclvCommented Oct 14, 2014 at 10:25
-
2"For .wav the audio signal is sampled at 44,100 times per second or more" There is no such limit on the wav format, 44100 Hz is a common sampling rate, but you can choose any integer sampling rate you like, both higher and lower. The same is true for FLAC. MP3 on the other hand is arbitrarily limited to some predefined sampling rates. Commented Oct 14, 2014 at 14:14