Go beyond HTML5's Audio tag and boost the audio capabilities of your web application with the Web Audio API. Packed with lots of code examples, crisp descriptions, and useful illustrations, this concise guide shows you how to use this JavaScript API to make the sounds and music of your games and interactive applications come alive. You need little or no digital audio expertise to get started. Author Boris Smus introduces you to digital audio concepts, then shows you how the Web Audio API solves specific application audio problems. If you're an experienced JavaScript programmer, you'll not only learn how to synthesize and process digital audio, you'll also explore audio analysis and visualization with this API. Learn Web Audio API, including audio graphs and the audio nodes Provide quick feedback to user actions by scheduling sounds with the API's precise timing model Control gain, volume, and loudness, and dive into clipping and crossfading Understand pitch and frequency: use tools to manipulate soundforms directly with JavaScript Generate synthetic sound effects and learn how to spatialize sound in 3D space Use Web Audio API with the Audio tag, getUserMedia, and the Page Visibility API Copyright 4 Table of Contents 7 Preface 9 Structure of This Book 9 Conventions Used in This Book 10 Using Code Examples 11 Safari庐 Books Online 11 How to Contact Us 12 Thanks! 12 Chapter聽1.聽Fundamentals 13 A Brief History of Audio on the Web 13 Games and Interactivity 14 The Audio Context 15 Initializing an Audio Context 16 Types of Web Audio Nodes 17 Connecting the Audio Graph 17 Power of Modular Routing 18 Loading and Playing Sounds 22 Putting It All Together 23 Chapter聽2.聽Perfect Timing and Latency 25 Timing Model 25 Precise Playback and Resume 25 Scheduling Precise Rhythms 27 Changing Audio Parameters 27 Gradually Varying Audio Parameters 28 Custom Timing Curves 30 Chapter聽3.聽Volume and Loudness 33 Equal Power Crossfading 35 Using Meters to Detect and Prevent Clipping 37 Dynamics Compression 40 Chapter聽4.聽Pitch and the Frequency Domain 41 Pitch and playbackRate 43 Multiple Sounds with Variations 44 Oscillator-Based Direct Sound Synthesis 46 Chapter聽5.聽Analysis and Visualization 49 Frequency Analysis 49 Animating with requestAnimationFrame 51 Visualizing Sound 52 Chapter聽6.聽Advanced Topics 55 Adding Effects via Filters 56 Procedurally Generated Sound 57 Room Effects 59 Spatialized Sound 61 Audio Processing with JavaScript 63 Chapter聽7.聽Integrating with Other Technologies 65 Setting Up Background Music with the Tag 65 Live Audio Input 66 Page Visibility and Audio Playback 67 Chapter聽8.聽Conclusion 69 Appendix聽A.聽Deprecation Notes 71 Appendix聽B.聽Glossary 73 About the Author 75 Go beyond HTML5’s Audio tag and boost the audio capabilities of your web application with the Web Audio API. Packed with lots of code examples, crisp descriptions, and useful illustrations, this concise guide shows you how to use this JavaScript API to make the sounds and music of your games and interactive applications come alive.You need little or no digital audio expertise to get started. Author Boris Smus introduces you to digital audio concepts, then shows you how the Web Audio API solves specific application audio problems. If you're an experienced JavaScript programmer, you’ll not only learn how to synthesize and process digital audio, you’ll also explore audio analysis and visualization with this API.Learn Web Audio API, including audio graphs and the audio nodesProvide quick feedback to user actions by scheduling sounds with the API’s precise timing modelControl gain, volume, and loudness, and dive into clipping and crossfadingUnderstand pitch and frequency: use tools to manipulate soundforms directly with JavaScriptGenerate synthetic sound effects and learn how to spatialize sound in 3D spaceUse Web Audio API with the Audio tag, getUserMedia, and the Page Visibility API