W3C home > Mailing lists > Public > public-audio@w3.org > October to December 2011

Web Audio API, Basic Examples & Demos

From: Alistair MacDonald <al@signedon.com>
Date: Mon, 28 Nov 2011 16:46:07 -0500
Message-ID: <CAJX8r2m2q6X+-tmzmQRU+Cw8oNcpMKW5CS4L8YCdrC9_8e3B+g@mail.gmail.com>
To: public-audio@w3.org
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:

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

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.


        -        -        -

*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.


        -        -        -

*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.)


        -        -        -

*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.


        -        -        -


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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:49:57 UTC