O'Reilly logo

JavaScript for Sound Artists by Steve Leonard, William Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2  Getting Started with JavaScript and the Web Audio API

Images  Hello Sound Program

In an introduction to a programming language, the first program you write is often called “Hello World,” which prints the words “Hello World” on the screen. Because we are using the Web Audio API to create sounds, this section explains how to create a “Hello Sound” application that immediately plays a sound when you run it.

Copy the folder web audio template from the last chapter to a new directory, and rename the copy to hello_sound.

Type the code below into the app.js file that is present within the hello_sound folder. Save it and then launch the index.html file ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required