concept sound class in category javascript

appears as: Sound class
JavaScript on Things: Hacking hardware for web developers

This is an excerpt from Manning's book JavaScript on Things: Hacking hardware for web developers.

Web Audio and the Sound class

Sound is a JavaScript class that encapsulates the loading and playing of the sound file at the url passed to its constructor. It uses the Web Audio API. Its source is reproduced in listing 12.16; you can put it at the top of the PuckChime.js file. Alternatively, you can find the entire PuckChime.js source, including the Sound class, in the book’s GitHub repository.