Web Audio API, Basic Examples & Demos

Basic Examples Wiki Page
====================

While at TPAC we were brainstorming and added a page to the Wiki called
"Basic-Examples". These basic examples are designed to be clear for people
who may not understand some of technical terms use in the spec
documentation. The Basic Examples wiki page can be found here:
http://www.w3.org/2011/audio/wiki/Basic-Examples

I also threw together some demos for *some* of these basic examples (some
already exist on HTML5 Rocks, and we should update the wiki to include
these links). If you read below you can take a look at working demos I
whipped up to demonstrate 4 of the Basic Examples from the Wiki page. Some
minor things need changing in my code, but it may help to give less
technically minded people an idea of what the the Web Audio API does.

The code in each example is also pretty clean and commented, so I also hope
that any developers wishing to test this API out will find these demos
useful.




Working Demos
============

*Looping Sounds Without Gaps*

When you load this page you should be hear a short piece of music that
loops continually. (There may be a short pause while the sounds is loaded
from the server.) Looping is seamless, with no glitches in the sound as the
audio reaches the end of the sound file and begins playing again.

http://www.f1lt3r.com/w3caudio/web-audio-api/basic-examples/looping-sounds-without-gaps.html

        -        -        -

*Low-Latency Playback: From User Input*

This demo shows allows you to hit a key or click the mouse to fire a sound.
Try this yourself and see how quick or slow the browser plays your sound
using the Web Audio API.

http://www.f1lt3r.com/w3caudio/web-audio-api/basic-examples/low-latency-playback-user-input.html

        -        -        -

*Audio Filters: Controlling Bass & Treble*

This page has music playing in the background. Use the Bass and Treble
sliders below to control the tone of the music. (You may have to wait a
moment for the sound to load from the server.)

http://www.f1lt3r.com/w3caudio/web-audio-api/basic-examples/audio-filters-bass-treble-control.html

        -        -        -

*Automating The Volume Over Time*

Once the music has downloaded from the server, you will hear the music
begin to play. You will notice that the volume of the music is going up and
down over time. This effect has been achieved using Parameter Automation on
the Gain Node.

http://www.f1lt3r.com/w3caudio/web-audio-api/basic-examples/automating-the-volume-over-time.html

        -        -        -



Thanks,

Alistair

Received on Monday, 28 November 2011 21:46:36 UTC