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
160
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
820
Lions and tigers and handling user capabilities
theophani
1
660
What about the CSSOM?
theophani
3
480
Cutting the fat
theophani
4
590
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
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
110
SpringBoot3.4の構造化ログ #kanjava
irof
2
990
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
2
200
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
36
14k
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
740
Unity Android XR入門
sakutama_11
0
160
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
250
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
120
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
150
パスキーのすべて ── 導入・UX設計・実装の紹介 / 20250213 パスキー開発者の集い
kuralab
3
780
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Six Lessons from altMBA
skipperchong
27
3.6k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
What's in a price? How to price your products and services
michaelherold
244
12k
The Pragmatic Product Professional
lauravandoore
32
6.4k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
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