Definitive Guide to HTML5 Video

Chapter 6: Manipulating Audio through the Web Audio API

Listing 6-1: Oscillator running with square wave of 3kHz

Listing 6-2: The parameters of the AudioContext

Listing 6-3: AudioParam automation

Listing 6-4: Gain changes on oscillator

Listing 6-5: Fetching a audio file into the AudioContext

Listing 6-6: Fetching an audio element into the AudioContext

Listing 6-7: Fetching an audio stream's audio into the AudioContext

Listing 6-8: Changing gain on playback of an audio file

Listing 6-9: Decaying echo via gain and delay filters

Listing 6-10: Different filter types applied to an audio source

Listing 6-11: Draw frequency-gain graph

Listing 6-12: Draw filters of listing 6-10 into graph

Listing 6-13: Waveshaper distortion on an audio file

Listing 6-14: Changing pan position on playback of an audio file

Listing 6-15: Applying different convolutions to an audio file

Listing 6-16: Different gains to right and left channels

Listing 6-17: Dynamic compression of an audio signal

Listing 6-18: Changing the position of a listener

Listing 6-19: Changing the position of a sound source

Listing 6-21: Processing audio data in an OfflineAudioContext

Listing 6-22: Rendering waveform data of an AudioContext