SlideShare a Scribd company logo
Web Audio API의
                                                         가능성 엿보기



http://www.flickr.com/photos/meaganjean/4263943043/


                                                             2012.07.07 / 박재성_nhn
Index
 1. Introduction
 •   <audio> tag
 •   Web Audio API
 •   Brief History
 •   브라우저 지원 여부
 •   Modular Routing


 2. 인터페이스
 3. 기본 사용방법

 4. How to use? : 다양한 응용방법
 •    Background music
 •    <audio> to Web Audio API
 •    Sound effects
 •    3D Positional sound : AudioPannerNode
 •    Room effects and filters : ConvolverNode
 •    Detect clipping : JavaScriptNode


 5. Somethig more
 •    Automation
 •    몇 가지 기억할 것들
1. Introduction
<audio> tag : 웹에서의 사운드

 이미 HTML5 <audio> 태그를 통해 사운드를 재생할 수 있다.

 <audio controls loop>
   <source src=“music.wav">
 </audio>

 • 로딩과 디코딩에 대한 별도의 작업 없이 스트리밍으로 재생가능
 • 다양한 재생 컨트롤 API 제공 (음량 조절, 재생시간 조절, etc)
 • Media event를 통한 다양한 이벤트 처리

Recommended for you

NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계

Nexon Developers Conference 2017에서 발표한 자료입니다. 언리얼 엔진 4를 이용한 애니메이션 공유 캐릭터 초기 작업 내용입니다. Skeleton을 하나로 통합하여 모든 인간형 캐릭터가 사용합니다.

ue4mmorpganimation
React with Redux
React with ReduxReact with Redux
React with Redux

Intro course presentation for React with Redux. It is including how to make AJAX Request with React, use Middleware, Router, and Reselect. Github repo - https://github.com/stanimirtt/react-redux-course-2017

reactreduxajax requests
언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링

언리얼 엔진을 이용해서 오브젝트 풀링 구현 오브젝트 풀링에 대한 이해

unreal engineobject pooling
<audio> tag : 한계


 그러나…
 • 사운드 시그널에 필터를 적용할 수 없다.

 • Raw PCM 데이터 접근이 불가능 하다.

 • 청취자에 대한 개념이 없기 때문에, 음향에 대한
   공간 및 방향 설정 자체가 불가능 하다.
Web Audio API?

  웹 어플리케이션에서 오디오 데이터를 프로세싱 하거나 합성할 수 있는
   하이레벨(High-level) JavaScript API.
    Specification : http://www.w3.org/TR/webaudio/

  AudioContext는 모든 사운드 데이터를 관리 및 재생한다.

  음향 데이터가 최종적으로 송출 되려면 사운드 소스는, AudioContext
   인스턴스와 연결 되어야 한다.
Web Audio API? : First step
  // 1. Audio Context 생성
  var context = new webkitAudioContext();

  // 2. 사운드 소스 생성
  var source = context.createBufferSource();
  source.buffer = AudioBuffer_데이터;

  // 3. 소스를 스피커와 연결 (또는 다른 모듈과 연결)
  source.connect(context.destination);
Brief History
   Google과 Mozilla는 서로 다른 2개의 초안을 제안 (2011/12/15)

    Google : Web Audio API
     - 하이레벨 함수(이미 기능들이 정의된) 제공

    Mozilla : MediaStream Processing API(Audio Data API)
     - 로우레벨 접근
     - <audio> 태그 기반

      http://wiki.mozilla.org/Audio_Data_API

Recommended for you

Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course

Build over 20 mini JavaScript Projects with full source code https://skl.sh/3yJdYM0 Web Developer Setup use of Editor for JavaScript Code JavaScript Projects DOM Interactive Dynamic web pages Introduction web development Course Resource Guide. Getting started with JavaScript DOM coding and development Web Developer Setup use of Editor for JavaScript Code JavaScript Resources to explore more about JavaScript JavaScript DOM Object Selecting Page elements and more JavaScript querySelectorAll Get Page Elements Select ALL Page Events Element Event Listener access page content with JavaScript JavaScript and Page Input Values from Page Elements How to use JavaScript Request Animation Frame JavaScript Starter Projects DOM Simple Projects to Start Coding How to make Interactive DOM list saving to localstorage JavaScript Component Create a Star Rating Project JavaScript Game within the DOM Coin Toss Game Project JavaScript Typing Challenge Game with JavaScript DOM JavaScript DOM fun with Page Elements Moving Storing Keypress JavaScript Combo Guessing Game Exercise JavaScript Shape Clicker Game Click the shape quickly to win JavaScript Number Guessing Game with Game Logic JavaScript DOM Interactive Components and Useful Projects Pure JavaScript Accordion hide and show page elements JavaScript Drag and Drop Simple Boxes Component Dynamic Drag and Drop JavaScript Email Extractor Mini Project Create a Quiz with Javascript JSON quiz tracker JavaScript Image Preview File Reader Example JavaScript Interactive Dice Game with Page elements JavaScript Dice Game Challenge Lesson JavaScript DOM Fun Projects Interactive DOM Elements JavaScript Tip Calculator Project Tip Calculator Project Part 1 Tip Calculator Project Part 2 Pure JavaScript Calculator DOM page elements Project JavaScript Calculator Part 1 JavaScript Calculator Part 2 JavaScript Calculator Part 3 JavaScript Bubble Popping DOM Game Coding project How to move a Page Element With JavaScript DOM Mover Example Collision Detection between Page elements with JavaScript DOM JavaScript DOM Interactive Game

javascriptgameswebsite
Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023

Tata cahaya adalah seni pengaturan cahaya untuk menciptakan ilusi ruang dan waktu sehingga kamera dapat melihat objek dengan jelas. Teknologi AI pada kamera modern dapat menghasilkan foto yang bagus dengan mudah untuk pengguna awam. Komposisi gambar yang baik dapat membantu terciptanya karya seni dari sebuah foto dengan menggunakan teknik seperti garis, bentuk, dan pembagian ruang

soal dgp multimediasoal desain grafis percetakansmk muhammadiyah singkut
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java

Presentation for beginners. Explains some concurrency basics, how Software Transactional Memory (STM) works and some implementation details.

javaclojurestm
브라우저 지원 여부
    크롬 (윈도우, MacOS X, Linux)
    ChromeOS
    사파리 5.2 beta에서 지원예정 (nightly 빌드에서 이미 사용가능)
    iOS6 Safari




      http://developer.apple.com/technologies/ios6/
Modular Routing
  연결은 꼭 스피커와 직접적일 필요는 없으며, 중간에 여러 단계의 AudioNode
   들과 연결(Modular Routing)되어 파이프라이닝 될수 있다.

  이를 통해 중간 단계의 AudioNode를 통해 음량 조정, 필터 적용 등을 처리
   하게 된다.
2. 인터페이스
인터페이스 : AudioNode

  모듈(노드)을 의미하며, 각 모듈들은 특별한 기능을 수행한다.


 interface AudioNode {
      void connect(in AudioNode destination, in unsigned long output = 0, in unsigned long input = 0);
      void disconnect(in int output = 0);

       readonly attribute AudioContext context;
       readonly attribute unsigned long numberOfInputs;
       readonly attribute unsigned long numberOfOutputs;
 }


  source.connect(destination_node);

Recommended for you

ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review

This is a detailed review of ACM International Collegiate Programming Contest (ICPC) Northeastern European Regional Contest (NEERC) 2016 Problems. It includes a summary of problem and names of problem authors and detailed runs statistics for each problem. Problem statements are available here: http://neerc.ifmo.ru/information/problems.pdf The beginning of the following video has the actual review (in Russian): https://www.youtube.com/watch?v=fN25KkNYsjA

contestacmneerc
Modul praktikum pbo java swing
Modul praktikum pbo java swingModul praktikum pbo java swing
Modul praktikum pbo java swing

JAVA SWING

#java #pemogramanjaringan #komputasi #netbeans
C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발

KGC2008 강연

인터페이스 : AudioParam
  각각의 AudioNode들은 AudioParam 형식의 메서드를 갖으며, 이는 자동화
    처리와 관련된 메서드를 제공한다.
    http://www.w3.org/TR/webaudio/#AudioParam
 interface AudioParam {
       attribute float value;
       readonly attribute float minValue;
       readonly attribute float maxValue;
       readonly attribute float defaultValue;

      readonly attribute DOMString name;

      // Should define units constants here (seconds, decibels, cents, etc.)
      readonly attribute short units;

      // Parameter automation.
      void setValueAtTime(in float value, in float time);
      void linearRampToValueAtTime(in float value, in float time);
      void exponentialRampToValueAtTime(in float value, in float time);

      // Exponentially approach the target value with a rate having the given time constant.
      void setTargetValueAtTime(in float targetValue, in float time, in float timeConstant);

      // Sets an array of arbitrary parameter values starting at time for the given duration.
      // The number of values will be scaled to fit into the desired duration.
      void setValueCurveAtTime(in Float32Array values, in float time, in float duration);

      // Cancels all scheduled parameter changes with times greater than or equal to startTime.
      void cancelScheduledValues(in float startTime);
 }
인터페이스 : AudioBuffer
  메모리에 올려진 디코딩된 사운드 데이터를 의미한다.
    http://www.w3.org/TR/webaudio/#AudioBuffer


 interface AudioBuffer {
      // linear gain (default 1.0)
      attribute AudioGain gain;

      readonly attribute float sampleRate;
      readonly attribute long length;

      // in seconds
      readonly attribute float duration;

      readonly attribute int numberOfChannels;

      Float32Array getChannelData(in unsigned long channel);
 }
인터페이스 : AudioBufferSourceNode
  AudioBuffer를 한번 재생할 수 있으며, 여러 개의 노드들은 동일한
   AudioBuffer를 가리킬 수도 있다.
    http://www.w3.org/TR/webaudio/#AudioBufferSourceNode

 interface AudioBufferSourceNode : AudioSourceNode {
       // Playback this in-memory audio asset
       // Many sources can share the same buffer
       attribute AudioBuffer buffer;

      readonly attribute AudioGain gain;
      attribute AudioParam playbackRate;
      attribute boolean loop;

      void noteOn(in double when);
      void noteGrainOn(in double when, in double grainOffset, in double grainDuration);
      void noteOff(in double when);
 }


 var source = context.createBufferSource();
 source.buffer = AudioBuffer_데이터;
 source.loop = true | false; // 반복여부
3. 기본 사용방법

Recommended for you

게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치
ndc2011
12 prinsip animasi
12 prinsip animasi12 prinsip animasi
12 prinsip animasi

Prinsip Animasi adalah konsep dasar dalam pembuatan animasi. prinsip ini diciptakan oleh animator Disney yaitu Ollie Johnston dan Frank Thomas. Dalam prinsip animasi yang di utarakan kedua animator disney tersebut, mereka menyatakan ada 12 prinsip dasar animasi yang harus diketahui agar animasi yang nantinya terbuat bisa dinikmata sebagai karya seni berkualitas. prinsip-prinsipnya diantara lain adalah: Solid Drawing Timing & Spacing Squash & Stretch Anticipation Slow in and Slow out Arcs Secondary Action Follow Through & Overlapping Action Straight Ahead Action and Pose to Pose Staging Appeal Exaggeration Itulah ke 12 prinsip dasar dalam pembuatan animasi. jika ingin mengetahui apa saja pengertian dan contoh dari ke-12 prinsip tersebut, download saja powerpoint 12 prinsip dasar animasi di bawah ini : http://presentasimemukau.blogspot.co.id/2017/01/12-prinsip-animasipptx.html

animationeducationpresentations
Google mock training
Google mock trainingGoogle mock training
Google mock training

The document provides an introduction and overview of using Google Mock (gmock) for testing in C++. It discusses key concepts like the system under test (SUT), test doubles, mocks, stubs, and fragile tests. It then provides a tutorial example of defining a mock class for a Turtle interface to allow testing code that depends on drawing functions without executing the real drawing implementation.

googlemock
기본 사용방법 : 컨텍스트 생성과 루팅
 // Audio Context 생성
 var context = new webkitAudioContext();

 // 사운드 소스 생성
 var source = context.createBufferSource();
 source.buffer = AudioBuffer_데이터;

  스피커와 직접 연결 :
 source.connect(context.destination);

  gainNode 연결 :
 var gainNode = context.createGainNode();
 source.connect(gainNode);
 gainNode.connect(context.destination);

  GainNode를 Compressor와 연결 :
 var compressor = context.createDynamicsCompressor();
 gainNode.connect(compressor);
 compressor.connect(context.destination);

 source.noteOn(0); // play
기본 사용방법 : 소스 데이터 로딩
 var request = new XMLHttpRequest();
 request.open('GET', sUrl, true);
 request.responseType = 'arraybuffer'; // 전송받을 data가 바이너리이므로 arraybuffer로 설정

 // XHR load callback
 request.onload = function() {

      // 비동기 디코딩 된다. 디코딩이 완료되면 디코딩된 PCM audio data를 사용할 수 있도록 준비된다.
      context.decodeAudioData(request.response,

           // 로드 콜백 함수
           function(buffer) {
                 ...
           },

           // 에러 콜백 함수
           function(e) {
                 console.log(e);
           }
      );
 };

  request.send();
4. How to use? : 다양한
응용방법
Background music

  게임에서 반복적이고 예측 가능한 BGM은 불편과 짜증을 유발할 수 있다.

  특정 시점(마지막 보스와의 대결과 같은)에 BGM도 그에 따라 감성적으로 반영이
   되어야 한다.

  여러 사운드의 믹싱은 음악 프로그램에서 제공하는 기본적인 기능 중 하나이다.

  Web Audio API를 활용해 XHR로 상황에 맞는 소스를 로딩해 재생할 수 있다.
    로딩은 시간이 소요되므로, 최초 페이지 로딩시 또는 게임 진행 중
     점진적으로 로딩을 하도록 한다.

Recommended for you

NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
온라인mmo게임
Building a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDBBuilding a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDB

This document discusses building a distributed job queue in MongoDB. It begins by outlining the requirements of processing tasks across multiple servers. It then describes the design of storing messages and tasks in MongoDB collections, including different message and task states. It also covers techniques like composite tasks, reducing polling through tailable cursors, and optimizing performance through retry logic and oplog replay. The overall aim is to build an asynchronous and scalable way to process jobs in a distributed manner using MongoDB.

Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)

Proses produksi merupakan tahap pengambilan gambar dan audio menggunakan peralatan seperti kamera, tripod, dan mikrofon sesuai dengan konsep yang dirancang sebelumnya. Tahap ini melibatkan pengaturan ukuran gambar, gerakan kamera, pencahayaan, dan suara untuk menangkap materi secara profesional. Tujuannya adalah menghasilkan video digital berkualitas sesuai harapan.

tkj 1 - smk negeri 1 jakarta
Background music
  사용될 각 노드들에 대한 소스를 생성하고 이를 연결한다.

  여러 개의 사운드가 반복 재생되는 상태에서, 특정 장면에 사용되는 사운드의
   음량을 키우고 사용되지 않는 사운드의 음량을 줄여 cross-fade 한다.
<audio> to Web Audio API
  <audio>는 소스를 모두 다운로드 받지 않아도 실시간 스트리밍으로 재생
   된다.

  스트리밍 소스를 Web Audio API와 연결하면 스트리밍을 분석하거나 조작할
   수 있게 된다.

  <audio>를 Web Audio context로 가져오는 것도 가능하다.

 var audioElement = document.querySelector('audio');
 var mediaSourceNode = context.createMediaElementSource(audioElement);

 mediaSourceNode.connect(context.destination);
 audioElement.play();


    createAnalyser() creates a RealtimeAnalyserNode which provide real-time frequency and time-
     domain analysis information.

      context.createAnalyser()를 통한 equalizer graph 데모 :
       http://html5-demos.appspot.com/static/webaudio/createMediaSourceElement.html
Sound effects : 재생 시점이 다른 반복 재생

  게임에서 여러 캐릭터가 다수 등장하는 배틀 장면인 경우에는 동시에 수많은
   이펙트가 재생될 수 있다.

  동일한 사운드 재생을 방지하기 위해 여러 종류의 사운드 풀을 준비해 사용할
   수도 있지만, 모든 상황을 대비하도록 구성하는 것은 어렵다.

  동일한 사운드를 재생시점을 다르게 지정해 풀을 구성하지 않고도, 동일한
   이펙트를 만들 수 있다.

 // currentTime은 컨텍스트가 생성된 시점을 기준으로 0의 값으로 시작하며, 실시간 증가되는 값이다.
 var time = context.currentTime;

 for (var i = 0; i < rounds; i++) {
    var source = AudioBufferSource;
    source.noteOn(time + i * interval);
 }
Sound effects : 시그널 지연
  DelayNode를 사용하면 오디오 시그널의 통과를 지연시킨다.


 var delayNode = context.createDelayNode(),
     now = context.currentTime;

 delayNode.delayTime.setValueAtTime(0, now);
 delayNode.delayTime.linearRampToValueAtTime(2, now + time);

Recommended for you

Introduction to three.js
Introduction to three.jsIntroduction to three.js
Introduction to three.js

Three.js is a powerful JavaScript library for creating 3D graphics in a web browser using WebGL. It allows placing 3D objects into a scene, defining a camera to view the scene, adding lighting, and rendering the 3D graphics. The basics of three.js include setting up a scene, camera, lights, geometry for 3D objects, materials, and a renderer. Examples are provided of what can be created with three.js like animated 3D graphics and a preview of a simple rolling ball demo.

유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현

유니티의 기본 툰셰이딩을 이용하여, 애니메이션 풍의 카툰 렌더링을 구현 하는 방법입니다. 아래 내용을 번역 하였습니다. http://qiita.com/MuRo_CG/items/c417ef6d6cbeed3dd42b

unityanimationtoonshading
제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary
Sound effects : 필터
  BiquadFilterNode를 사용해, 사운드 시그널의 주파수를 필터링해 주파수의
   응답을 변경할 수 있다.




 var filter = context.createBiquadFilter();
 source.connect(filter);

 // 0:LOWPASS, 1:HIGHPASS, 2:BANDPASS, 3:LOWSHELF, 4:HIGHSHELF, 5:PEAKING, 6:NOTCH, 7:ALLPASS
 filter.type = 0;
 filter.Q.value = 12.06;
 filter.frequency.value = 400;

 filter.connect(context.destination);
3D Positional sound

  AudioPannerNode를 활용해 위치와 공간을 프로세싱 한다.

 var panner = context.createPanner();

 // Directional model
 panner.coneOuterGain = 0.5;
 panner.coneOuterAngle = 180;
 panner.coneInnerAngle = 0;

 // Position, orientaion and velocity
 panner.setPosition(x, y, z);    // 3D cartesian coordinate relative to the listener attribute
 panner.setOrientation(x, y, z); // pointing in the 3D cartesian coordinate space
 panner.setVelocity(x, y, z);    // direction of travel and the speed in 3D space


 source.connect(panner);
 panner.connect(context.destination);
3D Positional sound

  Positional model은 OpenAL(Open Audio Library)에 기반한다.
    http://connect.creativelabs.com/openal/default.aspx

  Distance model은 소스로부터의 거리에 따라 gain 값을 다르게 갖는다.
  Directional model은 외부 또는 내부 방향에 따라 gain 값을 다르게 갖는다.




 Demo: http://www.html5rocks.com/en/tutorials/webaudio/positional_audio/
Room effects and filters

   동일한 소리를 장소에 따라 다르게 녹음된 데이터를 생성하는 것은 많은
    비용을 필요로 한다.

   동일한 사운드가 환경에 따라 다르게 들리는 것은 임펄스 응답(Impulse
    Response)의 차이라 할 수 있다.

   ConvolverNode를 활용하면 임펄스 응답을 간단히 적용할 수 있다.

  var source = context.createBufferSource();
  source.buffer = AudioBufferSource;

  var convolver = context.createConvolver();
  convolver.buffer = AudioBufferSource; // 임펄스 데이터

  source.connect(convolver);
  convolver.connect(context.destination);

Recommended for you

Html5 performance
Html5 performanceHtml5 performance
Html5 performance
corshtml5javascript
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트

The document discusses the process of creating charts with Raphael.js and SVG. It begins by asking why the author chose to create new charts rather than use existing ones, and why SVG and Raphael.js were selected. It then addresses challenges as this was the author's first time developing charts. Considerations around existing charting libraries and design/development processes are also mentioned.

공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)

KRNET 2014 발표 자료

openapi공공데이터
Detect clipping
  연결된 많은 AudioNode의 소리들이 normalize 되지 않으면 스피커 송출
   용량을 넘어설 수 있다.

  특정 채널의 시그널이 허용된 범위를 초과한 경우 clipping이 발생되며,
   -1 또는 1의 값으로 표현된다.

  이를 위해 JavaScriptAudioNode를 사용한다. JavaScriptAudioNode는
   audio를 JavaScript에서 직접 생성, 프로세스 또는 분석 할수 있게 한다.

 var meter = context.createJavaScriptNode(
     buffer_size,
     number_input_channel,
      number_output_channel
 );

 meter.onaudioprocess = function(e) {
   …
 }
Detect clipping
 // Assume entire sound output is being piped through the mix node.
 var mix = context.createGainNode();
 var meter = context.createJavaScriptNode(2048, 1, 1);

 // Porcess audio event binding
 meter.onaudioprocess = function (e) {
    var leftBuffer = e.inputBuffer.getChannelData(0);
    var rightBuffer = e.inputBuffer.getChannelData(1);
    checkClipping(leftBuffer);
    checkClipping(rightBuffer);
 };

 mix.connect(meter);
 meter.connect(context.destination);
 mix.connect(context.destination);

 // Check if buffer exceeds
 function checkClipping(buffer) {
    var isClipping = false;

     // Iterate through buffer to check if any of the |values| exceeds 1.
     for (var i = 0; i < buffer.length; i++) {
        var absValue = Math.abs(buffer[i]);
        if (absValue >= 1) {
            isClipping = true;
            break;
        }
     }
 }
5. Something more
Automation
  AudioNode의 AudioParam의 메서드를 이용해 특정 시간에 다른 값을 같도록
   처리할 수 있다.

  음량조절을 스케줄링하면, 페이드 처리가 자동으로 발생하도록 할수 있다.

 var now = context.currentTime;

 // 지정된 시간에 특정 값을 같도록 한다.
 source.gain.setValueAtTime(0, now);

 // 특정 시간까지 값을 리니어하게 변경하도록 스케줄링 한다.
 source.gain.linearRampToValueAtTime(1.0, now + value);
 source.gain.linearRampToValueAtTime(0.0, now + value);

Recommended for you

[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api

This document discusses Naver's open APIs and considerations for building mashup services using public data and APIs. It introduces various Naver open APIs for maps, search, and more. It covers technical topics like API programming methods and authentication. It also explores business models for combining public information through open APIs and mashups.

[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final
몇 가지 기억할 것들

  시그널이 부드럽고 튀지 않도록 DynamicCompressorNode를 활용하라.




  페이지가 보이지 않는 경우에는 pageVisibility API를 활용해 불필요한 사운드
   재생을 막는 것이 좋다.

  Web Audio API에서 모든 시간 단위는 밀리세컨드(millisecond)가 아닌
   초(second) 단위 이다.
다루지 못한 주제들

  Oscillator

  RealtimeAnalyserNode

  AudioChannelSplitter

  AudioChannelMerger

  WaveShaperNode
Reference
  Google I/O 2012 – Turning the Web Up to 11
    Presentaiton : http://webaudio-io2012.appspot.com
    Video : http://youtu.be/hFsCG7v9Y4c

  Getting started with Web Audio API
    http://www.html5rocks.com/en/tutorials/webaudio/intro/

  Developing game audio with the Web Audio API
    http://www.html5rocks.com/en/tutorials/webaudio/games/..

  Mixing positional audio and WebGL
    http://www.html5rocks.com/en/tutorials/webaudio/positional_audio/

  Web Audio Playground
    http://webaudioplayground.appspot.com/

  Web Audio Example
    http://chromium.googlecode.com/svn/trunk/samples/audio/index.html
http://www.flickr.com/photos/robinfeder/3482072805/

Recommended for you

[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발
[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io

The document discusses different types of users (A, B, C) and their perspectives on real-time web technologies. Type A users prefer simple explanations, while Type B users like examples and case studies. Type C users want discussions of principles and performance. The presenter then provides a high-level overview comparing the client-server approach of Comet to the true real-time model of Socket.io.

More Related Content

What's hot

TEKNIK ANIMASI TWEENING
TEKNIK ANIMASI TWEENING TEKNIK ANIMASI TWEENING
TEKNIK ANIMASI TWEENING
Diyah Rochmawati
 
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
Dewa Mahardika
 
Continuous Integration of Mobile Apps with Docker and Appium
Continuous Integration of Mobile Apps with Docker and AppiumContinuous Integration of Mobile Apps with Docker and Appium
Continuous Integration of Mobile Apps with Docker and Appium
Emergya
 
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
언호 이
 
React with Redux
React with ReduxReact with Redux
React with Redux
Stanimir Todorov
 
언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링
TonyCms
 
Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
Laurence Svekis ✔
 
Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023
SMK MUhammadiyah Singkut
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java
Misha Kozik
 
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
Roman Elizarov
 
Modul praktikum pbo java swing
Modul praktikum pbo java swingModul praktikum pbo java swing
Modul praktikum pbo java swing
stephan EL'wiin Shaarawy
 
C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발
흥배 최
 
게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치
Seungjae Lee
 
12 prinsip animasi
12 prinsip animasi12 prinsip animasi
12 prinsip animasi
prataMMa11
 
Google mock training
Google mock trainingGoogle mock training
Google mock training
Thierry Gayet
 
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
Jubok Kim
 
Building a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDBBuilding a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDB
MongoDB
 
Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)
Rizky Nurcahyati
 
Introduction to three.js
Introduction to three.jsIntroduction to three.js
Introduction to three.js
yuxiang21
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
MinGeun Park
 

What's hot (20)

TEKNIK ANIMASI TWEENING
TEKNIK ANIMASI TWEENING TEKNIK ANIMASI TWEENING
TEKNIK ANIMASI TWEENING
 
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
3.1 memahami prinsip dasar pembuatan animasi 2 dimensi (vector)
 
Continuous Integration of Mobile Apps with Docker and Appium
Continuous Integration of Mobile Apps with Docker and AppiumContinuous Integration of Mobile Apps with Docker and Appium
Continuous Integration of Mobile Apps with Docker and Appium
 
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언���얼 엔진4 애니메이션 공유 캐릭터 설계NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
NDC2017 언리얼 엔진4 애니메이션 공유 캐릭터 설계
 
React with Redux
React with ReduxReact with Redux
React with Redux
 
언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링
 
Javascript projects Course
Javascript projects CourseJavascript projects Course
Javascript projects Course
 
Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023Soal Desain Grafis dan Percetakan 2022/2023
Soal Desain Grafis dan Percetakan 2022/2023
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java
 
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems ReviewACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
ACM ICPC 2016 NEERC (Northeastern European Regional Contest) Problems Review
 
Modul praktikum pbo java swing
Modul praktikum pbo java swingModul praktikum pbo java swing
Modul praktikum pbo java swing
 
C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발C#을 사용한 빠른 툴 개발
C#을 사용한 빠른 툴 개발
 
게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치게임 애셋 스트리밍 패치
게임 애셋 스트리밍 패치
 
12 prinsip animasi
12 prinsip animasi12 prinsip animasi
12 prinsip animasi
 
Google mock training
Google mock trainingGoogle mock training
Google mock training
 
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
NDC2012 - 완벽한 MMO 클라이언트 설계에의 도전, Part2
 
Building a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDBBuilding a High-Performance Distributed Task Queue on MongoDB
Building a High-Performance Distributed Task Queue on MongoDB
 
Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)Simulasi Digital (Proses pengambilan gambar)
Simulasi Digital (Proses pengambilan gambar)
 
Introduction to three.js
Introduction to three.jsIntroduction to three.js
Introduction to three.js
 
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
유니티의 툰셰이딩을 사용한 3D 애니메이션 표현
 

Viewers also liked

제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary
NAVER D2
 
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트
NAVER D2
 
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
Channy Yun
 
[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api
NAVER D2
 
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
NAVER D2
 
[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final
NAVER D2
 
[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발
NAVER D2
 
[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth
NAVER D2
 
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
NAVER D2
 
[Hello world 오픈 세미나]ffmpeg android
[Hello world 오픈 세미나]ffmpeg android[Hello world 오픈 세미나]ffmpeg android
[Hello world 오픈 세미나]ffmpeg android
NAVER D2
 

Viewers also liked (11)

제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary제2회 hello world 오픈세미나 collie html5-animationlibrary
제2회 hello world 오픈세미나 collie html5-animationlibrary
 
Html5 performance
Html5 performanceHtml5 performance
Html5 performance
 
제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트제2회 hello world 오픈세미나 hello world-raphael차트
제2회 hello world 오픈세미나 hello world-raphael차트
 
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
공공 데이터 활용 방법론 - 오픈 API 기술 및 동향 (KRNET 2014)
 
[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api[Hello world 오픈세미나]공공정보와 네이버 오픈api
[Hello world 오픈세미나]공공정보와 네이버 오픈api
 
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
[Hello world 오픈세미나]거인을 이용해 뻔뻔(fun fun)하게 돈 벌기
 
[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final[Hello world 오픈세미나]소셜게임 a to z final
[Hello world 오픈세미나]소셜게임 a to z final
 
[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발[Hello world 오픈세미나]open api client개발
[Hello world 오픈세미나]open api client개발
 
[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth[Hello world 오픈 세미나]oauth
[Hello world 오픈 세미나]oauth
 
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io[Hello world 오픈세미나]실시간웹을위한comet과socket.io
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
 
[Hello world 오픈 세미나]ffmpeg android
[Hello world 오픈 세미나]ffmpeg android[Hello world 오픈 세미나]ffmpeg android
[Hello world 오픈 세미나]ffmpeg android
 

Similar to 제2회 hello world 오픈세미나 Web Audio API-가능성엿보기

Developing game audio with the Web Audio API
Developing game audio with the Web Audio APIDeveloping game audio with the Web Audio API
Developing game audio with the Web Audio API
Jae Sung Park
 
Android audio system(pcm데이터출력요청-서비스클라이언트)
Android audio system(pcm데이터출력요청-서비스클라이언트)Android audio system(pcm데이터출력요청-서비스클라이언트)
Android audio system(pcm데이터출력요청-서비스클라이언트)
fefe7270
 
Audio data preprocessing and data loading using torchaudio
Audio data preprocessing and data loading using torchaudioAudio data preprocessing and data loading using torchaudio
Audio data preprocessing and data loading using torchaudio
SeungHeon Doh
 
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
MaRoKim4
 
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
Wooyoung Ko
 
3D카툰메이커 완료세미나(복구됨)
3D카툰메이커 완료세미나(복구됨)3D카툰메이커 완료세미나(복구됨)
3D카툰메이커 완료세미나(복구됨)
Daniel Shin
 
Startup JavaScript 7 - Node.JS 기초
Startup JavaScript 7 - Node.JS 기초Startup JavaScript 7 - Node.JS 기초
Startup JavaScript 7 - Node.JS 기초
Circulus
 
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 ���계 및 개발
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
Jeongkyu Shin
 
초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드 초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드
YoungSu Son
 
Android Screen Recorder
Android Screen RecorderAndroid Screen Recorder
Android Screen Recorder
SooHwan Ok
 
Puppet과 자동화된 시스템 관리
Puppet과 자동화된 시스템 관리Puppet과 자동화된 시스템 관리
Puppet과 자동화된 시스템 관리
Keon Ahn
 
5-2. html5 multimedia
5-2. html5 multimedia5-2. html5 multimedia
5-2. html5 multimedia
JinKyoungHeo
 
20131217 html5
20131217 html520131217 html5
20131217 html5
DK Lee
 
Android mediacodec
Android mediacodecAndroid mediacodec
Android mediacodec
Taehwan kwon
 
20201121 코드 삼분지계
20201121 코드 삼분지계20201121 코드 삼분지계
20201121 코드 삼분지계
Chiwon Song
 
Android media codec 사용하기
Android media codec 사용하기Android media codec 사용하기
Android media codec 사용하기
Taehwan kwon
 
Voice Conversion : Audio알못에서 VCC2020참가까지
Voice Conversion : Audio알못에서 VCC2020참가까지Voice Conversion : Audio알못에서 VCC2020참가까지
Voice Conversion : Audio알못에서 VCC2020참가까지
Subin An
 
Open source engineering
Open source engineeringOpen source engineering
Open source engineering
YoungSu Son
 
Node.js at OKJSP
Node.js at OKJSPNode.js at OKJSP
Node.js at OKJSP
JeongHun Byeon
 
김기업_ EMOSIC_프로젝트 상세기술서
김기업_ EMOSIC_프로젝트 상세기술서김기업_ EMOSIC_프로젝트 상세기술서
김기업_ EMOSIC_프로젝트 상세기술서
Giup Kim
 

Similar to 제2회 hello world 오픈세미나 Web Audio API-가능성엿보기 (20)

Developing game audio with the Web Audio API
Developing game audio with the Web Audio APIDeveloping game audio with the Web Audio API
Developing game audio with the Web Audio API
 
Android audio system(pcm데이터출력요청-서비스클라이언트)
Android audio system(pcm데이터출력요청-서비스클라이언트)Android audio system(pcm데이터출력요청-서비스클라이언트)
Android audio system(pcm데이터출력요청-서비스클라이언트)
 
Audio data preprocessing and data loading using torchaudio
Audio data preprocessing and data loading using torchaudioAudio data preprocessing and data loading using torchaudio
Audio data preprocessing and data loading using torchaudio
 
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
2023 GDG Sondo DevFest - Flutter/ Flavor, PlatformChannel, Environment variab...
 
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
리스펙토링 세미나 - 웹 브라우저 동작 개념, Node.js를 통한 서버 이해, REST API
 
3D카툰메이커 완료세미나(복구됨)
3D카툰메이커 완료세미나(복구됨)3D카툰메이커 완료세미나(복구됨)
3D카툰메이커 완료세미나(복구됨)
 
Startup JavaScript 7 - Node.JS 기초
Startup JavaScript 7 - Node.JS 기초Startup JavaScript 7 - Node.JS 기초
Startup JavaScript 7 - Node.JS 기초
 
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발
 
초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드 초보 개발자/학생들을 위한 오픈소스 트랜드
초보 개발자/학생들을 위한 오픈소스 트랜드
 
Android Screen Recorder
Android Screen RecorderAndroid Screen Recorder
Android Screen Recorder
 
Puppet과 자동화된 시스템 관리
Puppet과 자동화된 시스템 관리Puppet과 자동화된 시스템 관리
Puppet과 자동화된 시스템 관리
 
5-2. html5 multimedia
5-2. html5 multimedia5-2. html5 multimedia
5-2. html5 multimedia
 
20131217 html5
20131217 html520131217 html5
20131217 html5
 
Android mediacodec
Android mediacodecAndroid mediacodec
Android mediacodec
 
20201121 코드 삼분지계
20201121 코드 삼분지계20201121 코드 삼분지계
20201121 코드 삼분지계
 
Android media codec 사용하기
Android media codec 사용하기Android media codec 사용하기
Android media codec 사용하기
 
Voice Conversion : Audio알못에서 VCC2020참가까지
Voice Conversion : Audio알못에서 VCC2020참가까지Voice Conversion : Audio알못에서 VCC2020참가까지
Voice Conversion : Audio알못에서 VCC2020참가까지
 
Open source engineering
Open source engineeringOpen source engineering
Open source engineering
 
Node.js at OKJSP
Node.js at OKJSPNode.js at OKJSP
Node.js at OKJSP
 
김기업_ EMOSIC_프로젝트 상세기술서
김기업_ EMOSIC_프로젝트 상세기술서김기업_ EMOSIC_프로젝트 상세기술서
김기업_ EMOSIC_프로젝트 상세기술서
 

More from NAVER D2

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인��지능 챗봇을 만든다
NAVER D2
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
NAVER D2
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
NAVER D2
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
NAVER D2
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
NAVER D2
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
NAVER D2
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
NAVER D2
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
NAVER D2
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
NAVER D2
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
NAVER D2
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
NAVER D2
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
NAVER D2
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
NAVER D2
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
NAVER D2
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 ���리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
NAVER D2
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
NAVER D2
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
NAVER D2
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝�� 통한 POI 변화 탐지
NAVER D2
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
NAVER D2
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
NAVER D2
 

More from NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

제2회 hello world 오픈세미나 Web Audio API-가능성엿보기

  • 1. Web Audio API의 가능성 엿보기 http://www.flickr.com/photos/meaganjean/4263943043/ 2012.07.07 / 박재성_nhn
  • 2. Index 1. Introduction • <audio> tag • Web Audio API • Brief History • 브라우저 지원 여부 • Modular Routing 2. 인터페이스 3. 기본 사용방법 4. How to use? : 다양한 응용방법 • Background music • <audio> to Web Audio API • Sound effects • 3D Positional sound : AudioPannerNode • Room effects and filters : ConvolverNode • Detect clipping : JavaScriptNode 5. Somethig more • Automation • 몇 가지 기억할 것들
  • 4. <audio> tag : 웹에서의 사운드 이미 HTML5 <audio> 태그를 통해 사운드를 재생할 수 있다. <audio controls loop> <source src=“music.wav"> </audio> • 로딩과 디코딩에 대한 별도의 작업 없이 스트리밍으로 재생가능 • 다양한 재생 컨트롤 API 제공 (음량 조절, 재생시간 조절, etc) • Media event를 통한 다양한 이벤트 처리
  • 5. <audio> tag : 한계 그러나… • 사운드 시그널에 필터를 적용할 수 없다. • Raw PCM 데이터 접근이 불가능 하다. • 청취자에 대한 개념이 없기 때문에, 음향에 대한 공간 및 방향 설정 자체가 불가능 하다.
  • 6. Web Audio API?  웹 어플리케이션에서 오디오 데이터를 프로세싱 하거나 합성할 수 있는 하이레벨(High-level) JavaScript API.  Specification : http://www.w3.org/TR/webaudio/  AudioContext는 모든 사운드 데이터를 관리 및 재생한다.  음향 데이터가 최종적으로 송출 되려면 사운드 소스는, AudioContext 인스턴스와 연결 되어야 한다.
  • 7. Web Audio API? : First step // 1. Audio Context 생성 var context = new webkitAudioContext(); // 2. 사운드 소스 생성 var source = context.createBufferSource(); source.buffer = AudioBuffer_데이터; // 3. 소스를 스피커와 연결 (또는 다른 모듈과 연결) source.connect(context.destination);
  • 8. Brief History  Google과 Mozilla는 서로 다른 2개의 초안을 제안 (2011/12/15)  Google : Web Audio API - 하이레벨 함수(이미 기능들이 정의된) 제공  Mozilla : MediaStream Processing API(Audio Data API) - 로우레벨 접근 - <audio> 태그 기반 http://wiki.mozilla.org/Audio_Data_API
  • 9. 브라우저 지원 여부  크롬 (윈도우, MacOS X, Linux)  ChromeOS  사파리 5.2 beta에서 지원예정 (nightly 빌드에서 이미 사용가능)  iOS6 Safari  http://developer.apple.com/technologies/ios6/
  • 10. Modular Routing  연결은 꼭 스피커와 직접적일 필요는 없으며, 중간에 여러 단계의 AudioNode 들과 연결(Modular Routing)되어 파이프라이닝 될수 있다.  이를 통해 중간 단계의 AudioNode를 통해 음량 조정, 필터 적용 등을 처리 하게 된다.
  • 12. 인터페이스 : AudioNode  모듈(노드)을 의미하며, 각 모듈들은 특별한 기능을 수행한다. interface AudioNode { void connect(in AudioNode destination, in unsigned long output = 0, in unsigned long input = 0); void disconnect(in int output = 0); readonly attribute AudioContext context; readonly attribute unsigned long numberOfInputs; readonly attribute unsigned long numberOfOutputs; }  source.connect(destination_node);
  • 13. 인터페이스 : AudioParam  각각의 AudioNode들은 AudioParam 형식의 메서드를 갖으며, 이는 자동화 처리와 관련된 메서드를 제공한다.  http://www.w3.org/TR/webaudio/#AudioParam interface AudioParam { attribute float value; readonly attribute float minValue; readonly attribute float maxValue; readonly attribute float defaultValue; readonly attribute DOMString name; // Should define units constants here (seconds, decibels, cents, etc.) readonly attribute short units; // Parameter automation. void setValueAtTime(in float value, in float time); void linearRampToValueAtTime(in float value, in float time); void exponentialRampToValueAtTime(in float value, in float time); // Exponentially approach the target value with a rate having the given time constant. void setTargetValueAtTime(in float targetValue, in float time, in float timeConstant); // Sets an array of arbitrary parameter values starting at time for the given duration. // The number of values will be scaled to fit into the desired duration. void setValueCurveAtTime(in Float32Array values, in float time, in float duration); // Cancels all scheduled parameter changes with times greater than or equal to startTime. void cancelScheduledValues(in float startTime); }
  • 14. 인터페이스 : AudioBuffer  메모리에 올려진 디코딩된 사운드 데이터를 의미한다.  http://www.w3.org/TR/webaudio/#AudioBuffer interface AudioBuffer { // linear gain (default 1.0) attribute AudioGain gain; readonly attribute float sampleRate; readonly attribute long length; // in seconds readonly attribute float duration; readonly attribute int numberOfChannels; Float32Array getChannelData(in unsigned long channel); }
  • 15. 인터페이스 : AudioBufferSourceNode  AudioBuffer를 한번 재생할 수 있으며, 여러 개의 노드들은 동일한 AudioBuffer를 가리킬 수도 있다.  http://www.w3.org/TR/webaudio/#AudioBufferSourceNode interface AudioBufferSourceNode : AudioSourceNode { // Playback this in-memory audio asset // Many sources can share the same buffer attribute AudioBuffer buffer; readonly attribute AudioGain gain; attribute AudioParam playbackRate; attribute boolean loop; void noteOn(in double when); void noteGrainOn(in double when, in double grainOffset, in double grainDuration); void noteOff(in double when); } var source = context.createBufferSource(); source.buffer = AudioBuffer_데이터; source.loop = true | false; // 반복여부
  • 17. 기본 사용방법 : 컨텍스트 생성과 루팅 // Audio Context 생성 var context = new webkitAudioContext(); // 사운드 소스 생성 var source = context.createBufferSource(); source.buffer = AudioBuffer_데이터;  스피커와 직접 연결 : source.connect(context.destination);  gainNode 연결 : var gainNode = context.createGainNode(); source.connect(gainNode); gainNode.connect(context.destination);  GainNode를 Compressor와 연결 : var compressor = context.createDynamicsCompressor(); gainNode.connect(compressor); compressor.connect(context.destination); source.noteOn(0); // play
  • 18. 기본 사용방법 : 소스 데이터 로딩 var request = new XMLHttpRequest(); request.open('GET', sUrl, true); request.responseType = 'arraybuffer'; // 전송받을 data가 바이너리이므로 arraybuffer로 설정 // XHR load callback request.onload = function() { // 비동기 디코딩 된다. 디코딩이 완료되면 디코딩된 PCM audio data를 사용할 수 있도록 준비된다. context.decodeAudioData(request.response, // 로드 콜백 함수 function(buffer) { ... }, // 에러 콜백 함수 function(e) { console.log(e); } ); }; request.send();
  • 19. 4. How to use? : 다양한 응용방법
  • 20. Background music  게임에서 반복적이고 예측 가능한 BGM은 불편과 짜증을 유발할 수 있다.  특정 시점(마지막 보스와의 대결과 같은)에 BGM도 그에 따라 감성적으로 반영이 되어야 한다.  여러 사운드의 믹싱은 음악 프로그램에서 제공하는 기본적인 기능 중 하나이다.  Web Audio API를 활용해 XHR로 상황에 맞는 소스를 로딩해 재생할 수 있다.  로딩은 시간이 소요되므로, 최초 페이지 로딩시 또는 게임 진행 중 점진적으로 로딩을 하도록 한다.
  • 21. Background music  사용될 각 노드들에 대한 소스를 생성하고 이를 연결한다.  여러 개의 사운드가 반복 재생되는 상태에서, 특정 장면에 사용되는 사운드의 음량을 키우고 사용되지 않는 사운드의 음량을 줄여 cross-fade 한다.
  • 22. <audio> to Web Audio API  <audio>는 소스를 모두 다운로드 받지 않아도 실시간 스트리밍으로 재생 된다.  스트리밍 소스를 Web Audio API와 연결하면 스트리밍을 분석하거나 조작할 수 있게 된다.  <audio>를 Web Audio context로 가져오는 것도 가능하다. var audioElement = document.querySelector('audio'); var mediaSourceNode = context.createMediaElementSource(audioElement); mediaSourceNode.connect(context.destination); audioElement.play();  createAnalyser() creates a RealtimeAnalyserNode which provide real-time frequency and time- domain analysis information.  context.createAnalyser()를 통한 equalizer graph 데모 : http://html5-demos.appspot.com/static/webaudio/createMediaSourceElement.html
  • 23. Sound effects : 재생 시점이 다른 반복 재생  게임에서 여러 캐릭터가 다수 등장하는 배틀 장면인 경우에는 동시에 수많은 이펙트가 재생될 수 있다.  동일한 사운드 재생을 방지하기 위해 여러 종류의 사운드 풀을 준비해 사용할 수도 있지만, 모든 상황을 대비하도록 구성하는 것은 어렵다.  동일한 사운드를 재생시점을 다르게 지정해 풀을 구성하지 않고도, 동일한 이펙트를 만들 수 있다. // currentTime은 컨텍스트가 생성된 시점을 기준으로 0의 값으로 시작하며, 실시간 증가되는 값이다. var time = context.currentTime; for (var i = 0; i < rounds; i++) { var source = AudioBufferSource; source.noteOn(time + i * interval); }
  • 24. Sound effects : 시그널 지연  DelayNode를 사용하면 오디오 시그널의 통과를 지연시킨다. var delayNode = context.createDelayNode(), now = context.currentTime; delayNode.delayTime.setValueAtTime(0, now); delayNode.delayTime.linearRampToValueAtTime(2, now + time);
  • 25. Sound effects : 필터  BiquadFilterNode를 사용해, 사운드 시그널의 주파수를 필터링해 주파수의 응답을 변경할 수 있다. var filter = context.createBiquadFilter(); source.connect(filter); // 0:LOWPASS, 1:HIGHPASS, 2:BANDPASS, 3:LOWSHELF, 4:HIGHSHELF, 5:PEAKING, 6:NOTCH, 7:ALLPASS filter.type = 0; filter.Q.value = 12.06; filter.frequency.value = 400; filter.connect(context.destination);
  • 26. 3D Positional sound  AudioPannerNode를 활용해 위치와 공간을 프로세싱 한다. var panner = context.createPanner(); // Directional model panner.coneOuterGain = 0.5; panner.coneOuterAngle = 180; panner.coneInnerAngle = 0; // Position, orientaion and velocity panner.setPosition(x, y, z); // 3D cartesian coordinate relative to the listener attribute panner.setOrientation(x, y, z); // pointing in the 3D cartesian coordinate space panner.setVelocity(x, y, z); // direction of travel and the speed in 3D space source.connect(panner); panner.connect(context.destination);
  • 27. 3D Positional sound  Positional model은 OpenAL(Open Audio Library)에 기반한다.  http://connect.creativelabs.com/openal/default.aspx  Distance model은 소스로부터의 거리에 따라 gain 값을 다르게 갖는다.  Directional model은 외부 또는 내부 방향에 따라 gain 값을 다르게 갖는다. Demo: http://www.html5rocks.com/en/tutorials/webaudio/positional_audio/
  • 28. Room effects and filters  동일한 소리를 장소에 따라 다르게 녹음된 데이터를 생성하는 것은 많은 비용을 필요로 한다.  동일한 사운드가 환경에 따라 다르게 들리는 것은 임펄스 응답(Impulse Response)의 차이라 할 수 있다.  ConvolverNode를 활용하면 임펄스 응답을 간단히 적용할 수 있다. var source = context.createBufferSource(); source.buffer = AudioBufferSource; var convolver = context.createConvolver(); convolver.buffer = AudioBufferSource; // 임펄스 데이터 source.connect(convolver); convolver.connect(context.destination);
  • 29. Detect clipping  연결된 많은 AudioNode의 소리들이 normalize 되지 않으면 스피커 송출 용량을 넘어설 수 있다.  특정 채널의 시그널이 허용된 범위를 초과한 경우 clipping이 발생되며, -1 또는 1의 값으로 표현된다.  이를 위해 JavaScriptAudioNode를 사용한다. JavaScriptAudioNode는 audio를 JavaScript에서 직접 생성, 프로세스 또는 분석 할수 있게 한다. var meter = context.createJavaScriptNode( buffer_size, number_input_channel, number_output_channel ); meter.onaudioprocess = function(e) { … }
  • 30. Detect clipping // Assume entire sound output is being piped through the mix node. var mix = context.createGainNode(); var meter = context.createJavaScriptNode(2048, 1, 1); // Porcess audio event binding meter.onaudioprocess = function (e) { var leftBuffer = e.inputBuffer.getChannelData(0); var rightBuffer = e.inputBuffer.getChannelData(1); checkClipping(leftBuffer); checkClipping(rightBuffer); }; mix.connect(meter); meter.connect(context.destination); mix.connect(context.destination); // Check if buffer exceeds function checkClipping(buffer) { var isClipping = false; // Iterate through buffer to check if any of the |values| exceeds 1. for (var i = 0; i < buffer.length; i++) { var absValue = Math.abs(buffer[i]); if (absValue >= 1) { isClipping = true; break; } } }
  • 32. Automation  AudioNode의 AudioParam의 메서드를 이용해 특정 시간에 다른 값을 같도록 처리할 수 있다.  음량조절을 스케줄링하면, 페이드 처리가 자동으로 발생하도록 할수 있다. var now = context.currentTime; // 지정된 시간에 특정 값을 같도록 한다. source.gain.setValueAtTime(0, now); // 특정 시간까지 값을 리니어하게 변경하도록 스케줄링 한다. source.gain.linearRampToValueAtTime(1.0, now + value); source.gain.linearRampToValueAtTime(0.0, now + value);
  • 33. 몇 가지 기억할 것들  시그널이 부드럽고 튀지 않도록 DynamicCompressorNode를 활용하라.  페이지가 보이지 않는 경우에는 pageVisibility API를 활용해 불필요한 사운드 재생을 막는 것이 좋다.  Web Audio API에서 모든 시간 단위는 밀리세컨드(millisecond)가 아닌 초(second) 단위 이다.
  • 34. 다루지 못한 주제들  Oscillator  RealtimeAnalyserNode  AudioChannelSplitter  AudioChannelMerger  WaveShaperNode
  • 35. Reference  Google I/O 2012 – Turning the Web Up to 11  Presentaiton : http://webaudio-io2012.appspot.com  Video : http://youtu.be/hFsCG7v9Y4c  Getting started with Web Audio API  http://www.html5rocks.com/en/tutorials/webaudio/intro/  Developing game audio with the Web Audio API  http://www.html5rocks.com/en/tutorials/webaudio/games/..  Mixing positional audio and WebGL  http://www.html5rocks.com/en/tutorials/webaudio/positional_audio/  Web Audio Playground  http://webaudioplayground.appspot.com/  Web Audio Example  http://chromium.googlecode.com/svn/trunk/samples/audio/index.html