Digital Audio

From Knowledge Kitchen
Jump to: navigation, 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.


Audacity


LAME

  • MP3 is a proprietary format
  • LAME is a copylefted tool that allows you to create MP3 files for free
    • the acronym, LAME, stands for LAME Ain't an MP3 Encoder
  • download one of the binary (i.e. easily installable) versions of LAME for your OS
  • whether or not using it infringes on the MP3 intellectual property is for a lawyer to decide
  • you can use LAME in order to export Audacity files as MP3s for your podcasts

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)
    • RSS is also used for syndicated news articles, and any other syndicated content
    • download a podcast RSS template

Create a podcast

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

Examples


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