Working with the Web Audio API
Working with the Web Audio API
Working with the Web Audio API is the definitive and instructive guide to understanding and using the Web Audio API.
The Web Audio API provides a powerful and versatile system for controlling audio on the web. It allows developers to generate sounds, select sources, add effects, create visualizations and render audio scenes in an immersive environment.
This book covers all essential features, with easy to implement code examples for every aspect. All the theory behind it is explained, so that one can understand the design choices as well as the core audio processing concepts. Advanced concepts are also covered, so that the reader will gain the skills to build complex audio applications running in the browser.
Aimed at a wide audience of potential students, researchers and coders, this is a comprehensive guide to the functionality of this industry-standard tool for creating audio applications for the web.
Joshua Reiss is a Professor with the Centre for Digital Music at Queen Mary University of London. He has published more than 200 scientific papers, and co-authored the book Intelligent Music Production and textbook Audio Effects: Theory, Implementation and Application. At the time of writing, he is the President of the Audio Engineering Society (AES). He co-founded the highly successful spin-out company LandR, and recently co-founded the start-ups Tonz and Nemisindo. His primary focus of research is on state-of-the-art signal processing techniques for sound design and audio production. He maintains a popular blog, YouTube channel and Twitter feed for scientific education and research dissemination.
Audio Engineering Society Presents
www.aes.org
Editorial Board
Chair:Francis Rumsey, Logophon Ltd.
Hyun Kook Lee, University of Huddersfield
Natanya Ford, University of West England
Kyle Snyder, University of Michigan
Intelligent Music Production
Brecht De Man, Joshua Reiss and Ryan Stables
The MIDI Manual 4e
A Practical Guide to MIDI within Modern Music Production
David Miles Huber
Digital Audio Forensics Fundamentals
From Capture to Courtroom
James Zjalic
Drum Sound and Drum Tuning
Bridging Science and Creativity
Rob Toulson
Sound and Recording, 8th Edition
Applications and Theory
Francis Rumsey with Tim McCormick
Performing Electronic Music Live
Kirsten Hermes
Working with the Web Audio API
Joshua Reiss
For more information about this series, please visit: www.routledge.com/Audio-Engineering-Society-Presents/book-series/AES
Working with the Web Audio API
Joshua Reiss
Cover image: Getty: naqiewei
First published 2022
by Routledge
4 Park Square, Milton Park, Abingdon, Oxon OX14 4RN
and by Routledge
605 Third Avenue, New York, NY 10158
Routledge is an imprint of the Taylor & Francis Group, an informa business
2022 Joshua Reiss
The right of Joshua Reiss to be identified as author of this work has been asserted in accordance with sections 77 and 78 of the Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this book may be reprinted or reproduced or utilised in any form or by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying and recording, or in any information storage or retrieval system, without permission in writing from the publishers.
Trademark notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe.
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library
Library of Congress Cataloging-in-Publication Data
Names: Reiss, Joshua D., author.
Title: Working with the Web Audio API / Joshua Reiss.
Description: Abingdon, Oxon ; New York, NY : Routledge, 2022. |
Includes bibliographical references and index.
Identifiers: LCCN 2021052201 (print) | LCCN 2021052202 (ebook) |
ISBN 9781032118680 (hardback) | ISBN 9781032118673 (paperback) |
ISBN 9781003221937 (ebook)
Subjects: LCSH: Computer sound processingHandbooks, manuals, etc. |
SoundRecording and reproducingDigital techniques. | Application program
interfaces (Computer software)Handbooks, manuals, etc. |
JavaScript (Computer program language)Handbooks, manuals, etc. |
Web applicationsDesign and constructionHandbooks, manuals, etc.
Classification: LCC TK7881.4 .R455 2022 (print) |
LCC TK7881.4 (ebook) | DDC 621.389/3dc23/eng/20220124
LC record available at https://lccn.loc.gov/2021052201
LC ebook record available at https://lccn.loc.gov/2021052202
ISBN: 978-1-032-11868-0 (hbk)
ISBN: 978-1-032-11867-3 (pbk)
ISBN: 978-1003-22193-7 (ebk)
DOI: 10.4324/9781003221937
Typeset in Times New Roman
by Newgen Publishing UK
Access the companion website: https://github.com/joshreiss/Working-with-the- Web-Audio-API
Contents
Figures
Code examples
Resources
All code examples are available at;
https://github.com/joshreiss/Working-with-the-Web-Audio-API
YouTube videos related to the book can be found at:
https://tinyurl.com/y3mtauav
We make extensive use of the Web Audio API documentation
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
and especially the Web Audio API specification
www.w3.org/TR/webaudio/
Sound files used in the source code were all public domain or Creative Commons licensed.
From Cambridge Multitracks,
From Nemisindo, https://nemisindo.com, we used
From FreeSound, https://freesound.org/
Preface
The Web Audio API is the industry-standard tool for creating audio applications for the web. It provides a powerful and versatile system for controlling audio on the Web, allowing developers to generate sounds, select sources, add effects, create visualizations and render audio scenes in an immersive environment. The Web Audio API is gaining importance and becoming an essential tool both for many of those whose work focuses on audio, and those whose work focuses on web programming.
Though small guides and formal specifications exist for the Web Audio API, there is not yet a detailed book on it, aimed at a wide audience of potential students, researchers and coders. Also, quite a lot of the guides are outdated. For instance, many refer to the deprecated ScriptProcessorNode
, and make no mention of the AudioWorkletNode
, which vastly extends the Web Audio APIs functionality.
This book provides a definitive and instructive guide to working with the Web Audio API. It covers all essential features, with easy-to-implement code examples for every aspect. All the theory behind it is explained, so that one can understand the design choices as well as the core audio processing concepts. Advanced concepts are also covered, so that the reader will gain the skills to build complex audio applications running in the browser.