Digital Audio

From Knowledge Kitchen
Jump to navigation Jump to search

Digital Audio

Analog Sound

  • consists of variations in air pressure
    • low-pitch sounds oscillate the air pressure at low frequencies
    • high-pitch sounds oscillate the air pressure at high frequencies
    • the number of oscillations per second of any signal is known as Hertz, sometimes written Hz.
  • these variations in air pressure causes movement in inner ear
  • your inner ear can respond to sounds between 20Hz and 20,000Hz, assuming you have "perfect hearing"
  • this movement your inner ear is translated into electrical voltage by the cochlea inside your inner ear
  • these electrical voltage changes cause electric signals to flow to the brain via neurons
  • your brain/mind interprets those electrical signals as sound

Digital sound

  • in everyday usage, the word "digital" really just means binary
  • digital sound, like all data on a contemporary computer, is stored in a binary format consisting of 0's and 1's
  • in order for sounds in real life to be recorded into a computer, the analog sound signal in real life must be converted to digital sound data in your computer
  • in order for you to hear digital sound from your computer via speakers or headphones, the digital binary data first has to be converted back to an analog signal
  • ADC
    • stands for analog-to-digital conversion
    • is the process of taking an analog signal (e.g. sound waves in the air), and converting it into a digital format (i.e. binary code in your computer)
  • DAC
  • Sampling
    • sampling is the process of reading an analog signal at a single point in time, and converting the analog value into a digital value
    • the audio signal's amplitude at the time of the sample is recorded.
  • Sampling Rate
    • how many times per second an ADC samples the signal
    • should generally be twice the frequency of the highest-pitched sound you want to capture
      • this is known as the Nyquist-Shannon Sampling Theorum, after its inventors
      • for example, if you are recording a sound that can go as high as 20,000Hz, your minimum sampling rate should be 40,000Hz.
    • so the sampling rate of the computer determines the maximum frequency of sound that can be recorded digitally
  • Bit depth
    • how many bits of data are used to represent the amplitude of each sample
    • higher bit depths mean more possible values a sample�s amplitude can have, just as with colors in Photoshop
    • standard CD audio bit depth is 16 bit
    • standard DVD audio bit depth is between 20 to 24 bits

An early 1980's television show named Bits and Bytes explained many of the concepts of digital audio very well in their episode on Computer Music. While hardware may have evolved since that time, the fundamental concepts behind digital audio have not.



  • MP3 is a proprietary format, not an open or free format
  • encoding and decoding audio to MP3 format, therefore uses proprietary MP3 technology that you would normally need a license to use
  • LAME is a copylefted tool that allows you to create MP3 files for free.
  • The project has created from scratch an MP3 encoder much the same way that GNU created from scratch the UNIX operating system.
    • in fact, the acronym, LAME, stands for LAME Ain't an MP3 Encoder, in homage to GNU
  • Lame comes bundled with Audacity, allowing you to export Audacity files as MP3s for your podcasts or web pages

Embedding audio in a web page

Distributing audio as a podcast

  • a podcast is simply a text file written in RSS code that links to the audio files you want to distribute
    • RSS is an XML-based markup language (like XHTML)
    • whereas HTML is a language designed to allow content to be interpreted by a web browser, RSS is a language designed to allow content to be interpreted by a Podcast player
    • RSS is also used to publish news articles, blog posts, and any other syndicated content... it was one of the major technologies that helped popularize blogs by allowing users to view posts from multiple blogs in a single place.
    • the major tech companies, especially Facebook, Google, and Apple have over the years been trying to rid the world of RSS in favor of their own proprietary formats, but it still is going strong (for now).

Create a podcast

This article from has a good overview of the process of creating and publishing a podcast. An simplified version of the publishing steps would be:

  1. create some audio files of your episodes and export them in MP3 format, OGG, or some other relatively widely-supported format
  2. copy and paste the code from any podcast RSS template
  3. replace the title, description, pubDate, link and copyright values with your own information
  4. replace the <item> tag with information that relates to your podcast. Note that you must enter absolute URLs to files in the <enclosure> tags.
  5. create as many <item> tags as you have audio files
  6. save the file as podcast.xml
  7. upload the podcast.xml and audio files to your website as you would web page documents
  8. link to your podcast from your website
    • add a regular link directly to your XML file from your web page
      • e.g.
    • add an iTunes-specific link to your XML file from your web page. This will automatically pop open the podcast in iTunes when clicked, if the user has it installed
      • e.g. itpc://

Sound sample libraries

These are libraries of sounds that you are free to use in your projects. Of course, you can always make your own sounds too.

What links here