What Format Does Spotify Use?

I was recently listening to Spotify and suddenly became aware of how much better the audio quality of compressed, digital music has gotten.  I remember when MP3s started gaining traction in the 90s, and these days most people associate any digital song with an MP3, but you may be surprised to learn that Spotify doesn’t use the MP3 format.

Spotify streams music using OGG-Vorbis, an open-source alternative to the patented MP3 format.  Like MP3, OGG is a “lossy” compression format but is generally considered to deliver superior sound quality.  The downside of OGG is that it is not as widely compatible across devices.

Like most audio formats, trying to figure out exactly what OGG is and what makes it unique can feel like wandering through Wonderland blindfolded.  Fortunately, once you get a grip on the basics, you’ll know if Spotify, and the OGG format, is the right fit for you.

The OGG-Vorbis Audio Format

In the early 90s, the MP3 format was developed and quickly made big waves in the digital music world.  Thanks to the clever format, people could suddenly store near-CD quality music at a fraction of the storage space. 

Remember, we didn’t have cell phones that shipped with a terabyte of storage back then.  Storage was a valuable commodity, and sacrificing 40 megabytes to house a CD was just not practical. 

But, in the latter part of the decade, a patent was granted for the MP3 format, and the inventors began calling in their owed royalties soon after that.  Finally, in 2004, Xiph.Org released the OGG container format as an open-source alternative to MP3.

Unlike many file formats, “OGG” isn’t an acronym for anything.  Instead, it is derived from the Netrek gaming term “ogging.”  In Netrek, if you used an ogg attack, you were using an aggressive kamikaze attack to destroy a high-value target.  So the extension is somewhat indicative of their market position against the MP3 extension.

The Difference Between OGG And Vorbis

In many instances, you may have seen the format written either as “OGG-Vorbis” or simply as “OGG,” so what’s the difference? 

To put it simply, OGG is the container file format.  In other words, it is a file format in which data can be stored.  Think of it like a .doc extension, a container specifically designed to house the data of a Microsoft Word text document and cannot house any other data.  

Unlike a .doc, OGG can hold various types of data, from text and images to audio and video data, and it keeps this data in a compressed format.  This is somewhat similar to a .zip container format, which is also designed to hold various different data types in a compressed state. 

However, how that data becomes compressed is where the important difference lies.  Which is where Vorbis comes in.

“Vorbis” is the method used to compress audio files that are then stored in the OGG container.  So, while the terms are often used interchangeably, there is a technical difference in their functionality.

OGG Is A Lossy Format

Like MP3 and AAC, OGG is a “lossy” compression format.  As the name suggests, this means that some of the data is lost during the process of compressing the audio. 

In fact, ‘lost’ is not technically the correct term because it makes it sound haphazard and accidental.  Technically, it would be far more accurate to say that some data is discarded during the conversion.

Again, this is better than it sounds (no pun intended).  When analog sounds are converted into digital files, they are essentially converted into ones and zeros.  The amount of data retained in this form is relatively high if you convert the sound exactly as is. 

This makes raw sound files cumbersome to store and troublesome to stream. 

The solution is to compress the data for storage and then unpack the compressed data for streaming, which is where audio formats come into play.

What lossy algorithms do, is identify and discard what it believes to be redundant audio data.  In other words, the algorithm will try to identify sounds that take up background space, are overly duplicated, or fall into a frequency that our ears can’t hear.  And then, it deletes that data. 

The more compressed you want the file to be, the more data will be discarded by the converter. 

Is OGG Better Than MP3?

As you can imagine, not all audio formats are created equally, even if they are intended to do the same thing.  Think of it like internal combustion engines:  they turn a crank using pistons that are driven by the combustion of fuel of air, but in reality, they all differ substantially.

In the same way, although they are designed to do the same thing, OGG and MP3 perform differently. 

One important difference is that MP3 uses a fixed bitrate, while OGG uses a variable bitrate.  In other words, an MP3 file will have the same rate of data flow throughout the song, even if there are moments of silence or fewer pieces of audio data. 

OGG, on the other hand, varies the flow of data to adjust for these changes.  So when there is more audio data, OGG uses more physical data, but in moments of silence, it will use no data at all. 

This variable bitrate makes OGG substantially better for streaming music than MP3, and it also means that stored songs will actually take up less hard drive space than MP3s. 

Furthermore, if you couple this variable bit rate with OGG’s slightly more advanced compression algorithm, the result is that songs simply sound better.  This is especially true at the very low bitrate end of the spectrum, where MP3s tend to sound quite bad. 

OGG Is Not As Popular As MP3

One drawback is that OGG, as a file extension, is less popular than MP3, which means that fewer devices and programs can play OGG songs natively. 

Using the Spotify application completely negates this problem because Spotify is built around OGG.  In other words, the Spotify app is a music player that can decompress and playback OGG files. 

So, if you use Spotify, you are unlikely to ever run into an issue where the OGG format isn’t recognized by your device because Spotify handles that backend work for you.

Why Does Spotify Use OGG Instead Of AAC?

There are instances where Spotify uses a different, more common audio format known as AAC, or Advanced Audio Coding, also used by Apple Music.  So, a common question is, why doesn’t Spotify just shift to AAC?

One of the reasons is that AAC is limited to a maximum bitrate of 256 kilobits per second (Kbps).  In contrast, OGG can deliver up to 320 Kbps.  Most audio tests tend to reflect this, saying that OGG sounds better at higher bitrates than AAC.  However, AAC sounds better at lower bitrates. 

In other words, Spotify’s argument for using OGG is to deliver higher-quality audio to their users, especially their subscribed users. 

Obviously, there is another big incentive for Spotify to continue using OGG, which is that OGG is in the public sphere and completely free to use, which saves Spotify a lot of money they would otherwise need to spend on licensing AAC.

Conclusion

Spotify uses the OGG-Vorbis audio format, developed as an open-source alternative to MP3.  OGG uses a variable bit rate compression, allowing the files to be kept smaller while maintaining better audio quality than most MP3s.  The variable bit rate also makes it better suited for a streaming service like Spotify.

References

Similar Posts