0:13
that's what we're going to cover in this video.
we're going to look at how to calculate storage space.
And then we're going to look at different file formats to use of lossless file
formats that preserve all of our amplitude values perfectly and lossy file
formats that can save us a lot of disk space but loosen data in the process.
so, before we look through the file formats lets just go through some very
simple calculations here. let's assume that we had 1 minute of
audio, at 16-bits, 44,100 Hz and stereo, so two channels.
How much disc space would this actually take up to store?
so we've got, 60 seconds, we've got, 44,000 100 samples per second.
and then we've got, 16 bits, per sample and two channels, two samples, per moment
in time. I'm not going to manually do all this
math for you, but this comes out to about 84 million Bits.
Now before you start freaking out that's bits, that's not usually how we talk
about digital data. So, if we convert this to bytes we divide
by 8 and then we're going to go to kilobytes we would divide by 1024 and
then if we wanted to go to megabytes, we'd divide by 1,024 again.
And that number is going to end up coming out to be about 10 MB.
So, in order to store 1 minute of 16-bit 44100 Hz stereo sound, we need about 10
MB of disk space. so, how are we going to store this.
Lets assume we've got plenty of space to store, that's not an issue, we just want
to store it on this. The, easiest thing we can do, is just to,
use a, a standard for, file format. Basically it takes all the amplitude
values, all the binary digits and just kind of plots them onto disk in a
structured format. And the two most popular formats for
doing that these days are WAVE files and AIFF files.
there was a time long ago when WAVE was the Windows format and AIFF was the Apple
format. in any music technology program, we'd be
encountering these days. they would both support, they would all
support both formats just as well. There's a lot of more obscure formats
that aren't used nearly as much. These two are supported by just about
every audio program out there. if we wanted to save some space, we could
try to compress this data. And we could use a lossless compression
format. What a lossless compression format would
do is something similar to what like a ZIP archive would do for other types of
files. It would go through and it would try to
re-encode all these amplitude values in a way that represents the most commonly
used ones a little bit more efficiently, at the expense of representing some of
the less frequently used ones less efficiently.
using a technique like this, we could save usually about 50%.
So, instead of, you know, our 10 MB per minute of CD quality sound we'd have
about 5 MB to represent that same minute. and the most popular format here is, is
FLAC, that stands for Free Lossless Audio Codec.
there's others that you'll encounter from time to time, ALAC is Apple's.
It's called Apple Lossless Audio Codec but it's not very well supported by, by
many other programs that aren't made by Apple or don't use Apple's APIs for
Audio. They're tools for importing and exporting
audio files. but this is somethings that's available.
if you need to get that two to one savings in size because you're trying to
email a file to someone or or share it somewhere or whatever might be.
but you want to keep all those amplitude values perfectly intact.
This can be a good technique. well what people usually want to do, wind
up doing when they want to save space is they use a lossy file format.
lossy file format we'll compress the, the file size in a way that you can never get
the original back but it does it using a perceptual encoding strategy.
In other words, it actually considers how we hear sound, psycho acoustic.
It's just like we were talking about earlier in this module and it, it, it
thinks about what are the things we're not going to miss so much in the sound.
What are some frequencies that we can't hear that well or particularly ones that
might get kind of hidden or covered up by other audio content that's in the sound.
They try to use that to make intelligent decisions about what to leave out and
what to keep in and you've all heard I'm sure of some popular file formats in the
lossy category. Mp3 is the most popular, AAC is fairly
popular as well, Ogg Vorbis is another one thats used quite a bit.
Many, many others as well, these are three of the most popular ones.
And they usually get you about a 90% savings over the original.
So, instead of 10 MB per minutes of CD quality sound, 44,100 Hz, 16 bit stereo,
you usually get about 1 MB per minute, depending on the exact savings.
So, that's a substantial savings particularly useful in a lot of scenarios
in terms of how we consume music today. if you are on your cell phone and you're
trying to stream music track from a music provider, you can't you know, you can't
as I stream a WAVE file on your crappy 3G connection or whatever connection you
have available. or you might not want to use your data
plan up for for all that streaming. So, you can use a lossy file format and
here's something that's pretty good over your cell phone but takes up only you
know, saves you 90% of your data. so it can be useful in a lot of
situations like that. I do want to issue a very important
warning here, it's, it's a lossy format for a reason, you can never get the
original back. And so if you're making your own music it
would be a horrible idea to only say that in a lossy format like an MP3 or an AAC
or Ogg Vorbis or something like that. Let's say you then later want them go
back and edit it or make some changes, or re-encode in another format.
well, you'd be doing all that for a version that has lost some of the
amplitude data of the original, those amplitude values are not going to be the
same as when you, when you created them, recorded them.
and so your is never going to sound quite as good as the original version that you
created in a lossless format. And if you then go and try to re-encode
it in a lossy format again, this is a very common thing to see.
Take an MP3 you know, decompress it into a WAVE form, do some editing on it and
save it as a MP3 again. Well, know we've basically done two
different MP3 compressions, the first one, you know when I save that the first
time and the second after I've decoded it and edited it and I'm saving it again.
and that's going to compound the effects of the, the, losses when I do that.
So its always a good idea when you're editing files, when you're working with
them, when you're saving them, y-, your own music for archival purposes, save it
in the loss, lossless format like a WAVE or an AIFF file or even like a FLAC, Free
Lossless Audio Codec. Something that's going to help you get
back the full quality of the original if you ever want to edit it or re-encode it
again in the future. So, in this video, we've talked briefly
about how to calculate the storage space of digital audio data based on decisions
we've made about bit width, the number of channels, and sampling rate.
we've talked about ways to reduce that storage space through lossless file
formats and lossy file formats and the implications of each.
in the last two videos of this module, we're going to move onto something a
little bit different but actually goes back to some of what we were talking
about when we looked at timbre. Which is essentially how do we create
this frequency representations of sound that we're looking at when we're talking
about timbre, the sonogram and the spectral view.