Digital audio: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
m (New page: {{Stub}} == Encoding formats == * MP3 * WMA * OGG * WAV (most often uncompressed PCM as in standard audio CDs) * AIFF == Overview of CD Formats == Most of these are called CD Rainbow Bo...)
 
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Stub}}
{{Stub}}


== Encoding formats ==
== Audio file formats ==


* MP3
{{quotation|It is important to distinguish between a file format and a [[codec]]. A codec performs the encoding and decoding of the raw audio data while the data itself is stored in a file with a specific audio file format}} ([http://en.wikipedia.org/wiki/Audio_file_format Wikipedia]).
* WMA
 
* OGG
=== Formats ===
* WAV (most often uncompressed PCM as in standard audio CDs)
 
* AIFF
Read:
* [http://en.wikipedia.org/wiki/Audio_file_format Audio File Format] (Wikipedia)
 
; Example of lossy compression
* MP3 - [[MPEG]] Layer-3
* OGG - Vorbis (most often with OGG container, therefore also known as OGG-Vorbis)
* AAC, MP4, M4a - MPEG 4 audio
 
; Lossless examples
* WMA - Microsoft
* FLAC
* WAV mostly for Windows PCs. Can use several compression codecs (most often uncompressed PCM as in standard audio CDs)
* AIFF (The Mac equivalent of WAV)


== Overview of CD Formats ==
== Overview of CD Formats ==
Line 13: Line 25:


# Red Book (CD Digital Audio). The basic standard for all CDs, including music CDs. Digital audio encoding: 2-channel signed 16-bit PCM sampled at 44,100 Hz.
# Red Book (CD Digital Audio). The basic standard for all CDs, including music CDs. Digital audio encoding: 2-channel signed 16-bit PCM sampled at 44,100 Hz.
# Yellow Book (CD-ROM and CD-ROM XA). CDs designed for a PC to read.
# Yellow Book (CD-ROM and CD-ROM XA). CDs for data (software)
# Orange Book (CD-R and CD-RW). CDs recordable by a PC.
# Orange Book (CD-R and CD-RW). Recordable CDs
# White Book (Video CD). CDs with video content that plays in most DVD players.
# White Book (Video CD). CDs with video content that plays in most DVD players.
# Blue Book (Enhanced CD, CD+G, and CD-Plus). Music CDs with extra features like videos or photos.
# Blue Book (Enhanced CD, CD+G, and CD-Plus). Music CDs with extra features like videos or photos.
Line 23: Line 35:
# Scarlet Book (SACD). '''Super Audio CD'''s uses Direct Stream Digital (DSD) recording, a proprietary Sony/Philips format. Quality is superb but needs a special player to work. There are three separate versions, one of which includes a red-book layer so that music will also play on an old CD player.
# Scarlet Book (SACD). '''Super Audio CD'''s uses Direct Stream Digital (DSD) recording, a proprietary Sony/Philips format. Quality is superb but needs a special player to work. There are three separate versions, one of which includes a red-book layer so that music will also play on an old CD player.
# DVD-Audio (DVD-A) is a Digital Versatile Disc (DVD) format that is specifically designed to hold high-quality audio data. An alternative to SA-CD
# DVD-Audio (DVD-A) is a Digital Versatile Disc (DVD) format that is specifically designed to hold high-quality audio data. An alternative to SA-CD
== Audio in web pages ==
=== HTML5 Audio ===
Audio works quite nicely in HTML5
* See [[HTML5 audio and video]]
=== HTML4 and XHTML1 Audio ===
==== Audio URLs ====
This is quite a nightmare. If you just use normal [[URL]]s, behavior will entirely depend on the configuration of your navigator and your system set-up. In any case, if you use firefox, you must install a mediaplayer plugin, e.g. Real Player, Quicktime, Windows Media.
E.g. in Firefox, select "Edit->Preferences" '''or'' "Tools->Options" (depending on your version). Then select the "Applications" tab. It will show how various audio files will be played and you can change that. E.g. on windows I use "Quicktime" and on Ubuntu the "mplayer" plugin.
==== Using the embed tag ====
Using the embed tag is probably the best solution for HTML4 audio, even if this tag is '''not''' an official part of HTML 4.x. Since the embed tag is official in HTML 5 it will survive, but it has different attributes. It also allows to adopt a user-friendly strategy, i.e. you can show a little control widget for playing the sound.
Attributes:
; src= "URL"
: The URL of the sound file
; loop= "true/false/N"
: Whether it should loop or how many times
; autostart = "true/flase"
: Whether it should automatically start.
; controls = "console|smallconsole|pausebutton|stopbutton|volumelever"
: Whether it will display a full console, a small one, juste a stop button or a volumelever
; hidden = "true/false"
: Hide/unhide. Hide if you really need background music
; height=XX
: defines the height of the player in pixels
; width=XX
: defines the width of the player in pixels
; border
; frameborder
;  align = "top|bottom|baseline|left|right
=== Using Flash ===
Simply include a [[Flash]] file. Make it very small if you don't want controls...
=== Using JavaScript ===
Source: [http://www.phon.ucl.ac.uk/home/mark/audio/play.htm Demonstration of Different Ways to Play a Sound from a Web Page]:
<pre>
<script>
function PlaySound(soundobj) {
  var thissound=document.getElementById(soundobj);
  thissound.Play();
}
</script>
<embed src="sound.mp3" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">
</pre>
Then call this function, e.g. from a button
<pre>
<form>
<input type="button" value="Play+" onClick="PlaySound('success.wav')">
</form>
</pre>
=== Using the object tag ===
In HTML4.x and XHTML 1.x, this should be the "standard" solution, but not as well implemented as the unofficial embed. Read [[HTML5 audio and video]] for better approach.
== Software ==
=== Editing tools ===
* [http://audacity.sourceforge.net/ Audacity] is probably the most popular free editing tool. Read [http://en.wikipedia.org/wiki/Audacity Wikipedia's Audacity] article.
** [http://wiki.audacityteam.org/index.php?title=Main_Page Audacity wiki] (manuals, tips, etc.)
=== Clients ===
* All web browsers can support audio in one or another way. HTML4/XHTML 1.1 only supports audio through plugins, HTML5 has built-in support for some formats
* A lot of audio players (by default each OS includes a player).


== Links ==
== Links ==
Line 32: Line 134:
* [http://en.wikipedia.org/wiki/High_fidelity High fidelity] (Wikipedia)
* [http://en.wikipedia.org/wiki/High_fidelity High fidelity] (Wikipedia)


=== Information about audio formats ===
* [http://www.wikirecording.org/ WikiRecording.org] A wiki on recording.
 
=== Information about audio file and compression formats ===
 
* [http://all-streaming-media.com/streaming-media-faq/faq-Description-of-popular-audio-formats-MP3-WMA-OGG-AAC-WAV.htm Description of popular audio formats] (Streaming media FAQ)
 
* [http://en.wikipedia.org/wiki/Audio_file_format Audio file format]
 
* [http://www.nch.com.au/acm/index.html Wave File Compression Codecs Compared]
 
* [http://en.wikipedia.org/wiki/WAV WAV] (Wikipedia).
 
* [http://lifehacker.com/5927052/whats-the-difference-between-all-these-audio-formats-and-which-one-should-i-use What’s the Difference Between All These Audio Formats, and Which One Should I Use?], Lifehacker, 2012.
 


* [http://all-streaming-media.com/streaming-media-faq/faq-Description-of-popular-audio-formats-MP3-WMA-OGG-AAC-WAV.htm Description of popular audio formats] (Streaming media FAQ


=== Information about CD standards ===
=== Information about CD standards ===
Line 45: Line 159:


* [http://en.wikipedia.org/wiki/Super_audio_CD Wikipedia Super Audio CD]
* [http://en.wikipedia.org/wiki/Super_audio_CD Wikipedia Super Audio CD]
=== HTML embedded sound ===
* [http://www.devx.com/projectcool/Article/20131/0/page/1 Inserting Audio] (Devx, Jan 2000)
* [http://www.htmlcodetutorial.com/embeddedobjects/_EMBED.html HTML Code tutorial - Embed]
* [http://www.webreference.com/js/column20/embed.html The EMBED Tag] (webreference.com)
* [http://forums.mozillazine.org/viewtopic.php?t=206216 Complete Embedded & Streaming Quicktime/Real/Windows Media Player Guide for Windows Users.] (Firefox / MozillaZine, Jan 2005).
* [http://www.phon.ucl.ac.uk/home/mark/audio/play.htm Demonstration of Different Ways to Play a Sound from a Web Page]


=== Other ===
=== Other ===
Line 50: Line 172:
* [http://www.proaudioreview.com/ ProAudio Review]. Online journal with reviews of products (some open access)
* [http://www.proaudioreview.com/ ProAudio Review]. Online journal with reviews of products (some open access)
* [http://www.dvdforum.org/tech-dvdprimer.htm DVD Primer], at DVDForum, 2000
* [http://www.dvdforum.org/tech-dvdprimer.htm DVD Primer], at DVDForum, 2000
[[Category:Multimedia]]
[[Category: Music]]

Latest revision as of 14:31, 5 February 2014

Draft

Audio file formats

“It is important to distinguish between a file format and a codec. A codec performs the encoding and decoding of the raw audio data while the data itself is stored in a file with a specific audio file format” (Wikipedia).

Formats

Read:

Example of lossy compression
  • MP3 - MPEG Layer-3
  • OGG - Vorbis (most often with OGG container, therefore also known as OGG-Vorbis)
  • AAC, MP4, M4a - MPEG 4 audio
Lossless examples
  • WMA - Microsoft
  • FLAC
  • WAV mostly for Windows PCs. Can use several compression codecs (most often uncompressed PCM as in standard audio CDs)
  • AIFF (The Mac equivalent of WAV)

Overview of CD Formats

Most of these are called CD Rainbow Books (referring to the color of the specification documents)

  1. Red Book (CD Digital Audio). The basic standard for all CDs, including music CDs. Digital audio encoding: 2-channel signed 16-bit PCM sampled at 44,100 Hz.
  2. Yellow Book (CD-ROM and CD-ROM XA). CDs for data (software)
  3. Orange Book (CD-R and CD-RW). Recordable CDs
  4. White Book (Video CD). CDs with video content that plays in most DVD players.
  5. Blue Book (Enhanced CD, CD+G, and CD-Plus). Music CDs with extra features like videos or photos.
  6. Beige Book (Photo CD). Kodak's format for storing photos on a CD.
  7. Green Book (CD-i). Rarely used. CD-Interactive contains educational material and games.
  8. Purple Book (DDCD) hold more storage than CDs and require a special reader, not popular
  9. High Density CD (HDCD), an alternative to DDCD, not popular
  10. Scarlet Book (SACD). Super Audio CDs uses Direct Stream Digital (DSD) recording, a proprietary Sony/Philips format. Quality is superb but needs a special player to work. There are three separate versions, one of which includes a red-book layer so that music will also play on an old CD player.
  11. DVD-Audio (DVD-A) is a Digital Versatile Disc (DVD) format that is specifically designed to hold high-quality audio data. An alternative to SA-CD

Audio in web pages

HTML5 Audio

Audio works quite nicely in HTML5

HTML4 and XHTML1 Audio

Audio URLs

This is quite a nightmare. If you just use normal URLs, behavior will entirely depend on the configuration of your navigator and your system set-up. In any case, if you use firefox, you must install a mediaplayer plugin, e.g. Real Player, Quicktime, Windows Media.

E.g. in Firefox, select "Edit->Preferences" 'or "Tools->Options" (depending on your version). Then select the "Applications" tab. It will show how various audio files will be played and you can change that. E.g. on windows I use "Quicktime" and on Ubuntu the "mplayer" plugin.

Using the embed tag

Using the embed tag is probably the best solution for HTML4 audio, even if this tag is not an official part of HTML 4.x. Since the embed tag is official in HTML 5 it will survive, but it has different attributes. It also allows to adopt a user-friendly strategy, i.e. you can show a little control widget for playing the sound.

Attributes:

src= "URL"
The URL of the sound file
loop= "true/false/N"
Whether it should loop or how many times
autostart = "true/flase"
Whether it should automatically start.
controls = "console|smallconsole|pausebutton|stopbutton|volumelever"
Whether it will display a full console, a small one, juste a stop button or a volumelever
hidden = "true/false"
Hide/unhide. Hide if you really need background music
height=XX
defines the height of the player in pixels
width=XX
defines the width of the player in pixels
border
frameborder
align = "top|bottom|baseline|left|right

Using Flash

Simply include a Flash file. Make it very small if you don't want controls...

Using JavaScript

Source: Demonstration of Different Ways to Play a Sound from a Web Page:

<script>
function PlaySound(soundobj) {
  var thissound=document.getElementById(soundobj);
  thissound.Play();
}
</script>

<embed src="sound.mp3" autostart=false width=0 height=0 id="sound1"
enablejavascript="true">

Then call this function, e.g. from a button

<form>
<input type="button" value="Play+" onClick="PlaySound('success.wav')">
</form>

Using the object tag

In HTML4.x and XHTML 1.x, this should be the "standard" solution, but not as well implemented as the unofficial embed. Read HTML5 audio and video for better approach.

Software

Editing tools

Clients

  • All web browsers can support audio in one or another way. HTML4/XHTML 1.1 only supports audio through plugins, HTML5 has built-in support for some formats
  • A lot of audio players (by default each OS includes a player).

Links

Overviews

Information about audio file and compression formats

  • WAV (Wikipedia).


Information about CD standards

  • SA-CD FAQ. Quote: This FAQ aims to be the most comprehensive concerning SA-CD on the web, but also independent, unbiased, practical and readable

HTML embedded sound

Other