Chapter 8: HTML5 Audio API - Examples

Note: samples 1-13 only work in Firefox 4+, while sample 14-16 need a custom build of Safari

  1. Listing 8-1: Reading audio samples from an audio element
  2. Listing 8-2: Reading audio samples from a video element
  3. Listing 8-3: Reading audio metadata for the audio framebuffer audio/video
  4. Listing 8-4: Reading the event time for the audio framebuffer audio/video
  5. Listing 8-5: Rendering the audio samples in a waveform
  6. Listing 8-6: Rendering the audio samples in a waveform with history
  7. Listing 8-7: Rendering the audio samples in a spectrum
  8. Listing 8-8: Creating a new audio element with a sine wave paint every 512th sample/paint every sample
  9. Listing 8-9: Creating a new audio element from existing one just sound/with canvas
  10. Listing 8-10: Displaying latency between playback on original audio element and scripted audio original/optimized
  11. Listing 8-11: Playing back all the samples from an input source just sound/with canvas
  12. Listing 8-12: Bleeping out a section of audio with a sine wave just sound/with canvas
  13. Listing 8-13: A Web-based tone generator just sound/with canvas
  14. Listing 8-14: Reading and writing sound using an AudioContext
  15. Listing 8-15: Creating a reverberation effect using the AudioContext convolution filter
  16. Listing 8-16: Rendering waveform data from an AudioContext filter graph