0

out of curiosity I was wandering around Spotify's resources regarding audio formats and how songs are accepted and reworked for publication. I have read that the three formats used on the platform are:

  • Ogg/Vorbis
  • AAC
  • HE-AACv2

In the case of Ogg/Vorbis, what operation is performed and what does the wave undergo in FLAC, what are the operations that are performed for the conversion of the wave?

2 Answers 2

0

In a typical CD recording (44.1kHz 16 bit), there are 44,100 samples per second and each sample represents a number between 0 and 32,768. This (theoretically) would enable us to playback a square wave sound at a little over 22kHz at full volume if we wanted to.

Any form of compression removes parts of these scales - for example, if we were using a 22kHz square wave, we would only need the top and bottom values. Instead of using all 16 bits to give us 32,768 different values, we could just use 1 bit and translate 0 as 0 and 1 as 32,768 during playback - saving 15 bits of information in each one of those 44,100 samples.

Most recordings don't use 22kHz square waves so we won't always be able to drop down as far as 1 bit but we might be able to take fewer samples per second.

Bad compression can be heard in early MP3 files where both the sample rate and the bit depth were reduced to remove data and therefore give a smaller file size.

Different compression types have different rules guiding which bits and which samples they can lose to find a compromise between sound quality and file size - I'm sure you could find some very dry data on exactly how this works for the different filetypes you mentioned somewhere on the web but it's probably PhD level mathematics.

Essentially, compressing sound files means taking away some of the data that the computer thinks you don't need and the different filetypes have different rules for doing that.

0

FLAC is a lossless compression format and optimised for it, so pretty boringly first FLAC (typically packaged in Ogg) is getting uncompressed into the original raw data, then Vorbis compresses this to its own lossy bitstream and Ogg packages that stream.

While very theoretically and handwavingly part of the analysis done in the course for creating FLAC could be reused for creating lossy compression formats, in practice the respective frame sizes and optimisations are too different: the purpose of lossy compression is to throw psychoacoustically irrelevant residual data away (or replace it with "equivalents") while lossless compression does not benefit from psychoacoustics because it needs to encode everything anyway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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