Top Banner
Create fun & immersive audio experiences with Web Audio
19

Create fun & immersive audio experiences with web audio

Jul 19, 2015

Download

Technology

davrous
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Create fun & immersive audio experiences with web audio

Create fun & immersive audio experiences with Web Audio

Page 2: Create fun & immersive audio experiences with web audio

[email protected] - @davrous - http://aka.ms/davrous

DAVIDROUSSETSenior Program ManagerMicrosoft Edge / Open Web StandardsDeveloper Experience and Evangelism

Page 3: Create fun & immersive audio experiences with web audio

Most advanced audio stack for the web!

<bgsound>

flash<audio>

Web Audio API

Learn Web Audio API

Page 4: Create fun & immersive audio experiences with web audio

Provides a complete access to the sound stream

Works via an audio routing graph based on nodes

Offers a precise control over

TimeFilterGain

Spectrum analyzerConvolvers3D spatialization

Web Audio in a nutshell

Page 5: Create fun & immersive audio experiences with web audio

Not running on UI Thread, little performance impact

Supported codecs are browser based: MP3 & WAVavailable everywhere

Scenarios: gaming, music web apps, speech synthesis, etc.

Web Audio powerful & performant

Page 6: Create fun & immersive audio experiences with web audio

Audio routing graph explained

Page 7: Create fun & immersive audio experiences with web audio

var canUseWebAudio = false;

try {

if (typeof AudioContext !== 'undefined') {

audioContext = new AudioContext();

canUseWebAudio = true;

} else if (typeof webkitAudioContext !== 'undefined') {

audioContext = new webkitAudioContext();

canUseWebAudio = true;

}

} catch (e) {

console.error("Web Audio: " + e.message);

}

Creating the AudioContext

Page 8: Create fun & immersive audio experiences with web audio

LET’S STARTFROM SCRATCH

Page 9: Create fun & immersive audio experiences with web audio

Mixing sounds in an easy way

Page 10: Create fun & immersive audio experiences with web audio

SYNCHONIZINGSOUNDS

Page 11: Create fun & immersive audio experiences with web audio

Analyzing sounds

Page 12: Create fun & immersive audio experiences with web audio

ANALYZINGSOUNDS

Page 13: Create fun & immersive audio experiences with web audio

Based on OpenAL (Open Audio Library)

Most of the complexity being handled for you

Omnidirectional or directional sounds• Position• Direction• Velocity (Doppler effect)

3D Sounds

Page 14: Create fun & immersive audio experiences with web audio

Oscillators

Procedural sounds

Filters

Convolvers effects (reverb, cathedral, phone, etc.)

Dynamic Compression

Web Audio: much more to discover!

Page 15: Create fun & immersive audio experiences with web audio

Babylon.js and Web Audio

Page 16: Create fun & immersive audio experiences with web audio

How to use BABYLON.JS?

Open source project (Available on Github)

http://www.babylonjs.com

http://cdn.babylonjs.com/2-0/babylon.js

How to use it? Include one file and you’re ready to go!

To start Babylon.js, you’ve just need to create an engine object:<script src="babylon.js"></script>

var engine = new BABYLON.Engine(canvas, true);

Page 17: Create fun & immersive audio experiences with web audio

Based on Web Audio

Ambient, omnidirectional & directional sounds

3D Sounds using linear attenuation by default

Handled by your code or our .babylon format file

Can be exported from 3DS Max (Blender & Unity to come)

Babylon.js audio engine

Page 18: Create fun & immersive audio experiences with web audio

BABYLONJSEXPERIMENTS

Page 19: Create fun & immersive audio experiences with web audio

THANK YOU!