Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WebAudio
Search
Tiffany Conroy
October 01, 2012
Programming
1
170
WebAudio
GET EXCITED AND PLAY!!
Tiffany Conroy
October 01, 2012
Tweet
Share
More Decks by Tiffany Conroy
See All by Tiffany Conroy
Beautiful Authentication: Tear down the barbed wire
theophani
3
830
Lions and tigers and handling user capabilities
theophani
1
680
What about the CSSOM?
theophani
3
500
Cutting the fat
theophani
4
600
When to use Ajax and when to reload
theophani
6
1.8k
Version Control All The Codes
theophani
12
1.2k
Design Processes, Not Interfaces
theophani
5
1.8k
Other Decks in Programming
See All in Programming
Ruby on Railroad: The Power of Visualizing CFG
ydah
0
290
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
1.1k
SwiftDataのカスタムデータストアを試してみた
1mash0
0
140
AIコーディングの理想と現実
tomohisa
35
37k
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
[NG India] Event-Based State Management with NgRx SignalStore
markostanimirovic
1
190
KANNA Android の技術的課題と取り組み
watabee
0
170
インプロセスQAにおいて大事にしていること / In-process QA Meetup
medley
0
130
DevOpsDaysTokyo2025社内副業で他部門へ_越境_して見えた価値再定義最大1か月のリードタイムを10分に短縮したDevOps実践.pdf
susumutomita
0
110
generative-ai-use-cases(GenU)の推しポイント ~2025年4月版~
hideg
1
370
GitHub Copilot for Azureを使い倒したい
ymd65536
1
300
Empowering Developers with HTML-Aware ERB Tooling @ RubyKaigi 2025, Matsuyama, Ehime
marcoroth
2
940
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
550
Making Projects Easy
brettharned
116
6.2k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
105
19k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.7k
How STYLIGHT went responsive
nonsquared
100
5.5k
Why Our Code Smells
bkeepers
PRO
336
57k
Building an army of robots
kneath
305
45k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
WEBAUDIO
WebAudio != <audio … >
// create new <audio> var audioElement = new Audio();
// create new WebAudio Context var context = new audioContext();
// create new WebAudio Context var context = new webkitAudioContext();
WICKED WEBAUDIO DEMOS http://chromium.googlecode.com/svn/trunk/samples/audio/samples.html
PLAY
audioElement.src = path // check/wait until you can play audioElement.play();
var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.noteOn(at); //
PLAY
var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.noteOn(at); //
PLAY
var source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); source.noteOn(at); //
PLAY
$.ajax({ url: "/path/to/my/sound/file", success: decodeAudioData, requestType: "arraybuffer" });
$.ajax({ url: "/path/to/my/sound/file", success: decodeAudioData, requestType: "arraybuffer" }); NOPE
var request = new XMLHttpRequest(); request.open("GET", "/path/to/sound"); request.responseType = "arraybuffer";
request.onload = decodeAudioData; request.send();
var request = new XMLHttpRequest(); request.open("GET", "/path/to/sound"); request.responseType = "arraybuffer";
request.onload = decodeAudioData; request.send();
var decodeAudioData = function() { context.decodeAudioData( request.response, decodeSuccess); };
var decodeSuccess = function(buffer) { doSomething(buffer); };
var decodeSuccess = function(buffer) { doSomething(buffer); };
var decodeSuccess = function(buffer) { doSomething(buffer); };
I MADE SOME FUNCTIONS github.com/theophani/load-sounds
var loadSound = function(path, callback) { // load the sound
sorta like I showed before };
var loadSounds = function(paths, callback) { // load a bunch
of sounds };
var playSound = function(buffer) { // stuff with source and
context };
Tiffany Conroy github.com/theophani/load-sounds @theophani