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
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
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
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
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
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.
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.
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.
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.
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.
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 오픈세미나]실시간웹을위한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.
Tweening adalah teknik animasi yang membuat objek bergerak secara teratur antara dua frame kunci awal dan akhir dengan otomatis membuat frame-frame diantaranya. Tweening dapat digunakan untuk berbagai jenis gerakan dan perubahan bentuk objek, serta menghemat waktu dan ukuran file animasi. Ada beberapa jenis tweening seperti classic, motion, dan motion guide tweening.
Continuous Integration of Mobile Apps with Docker and AppiumEmergya
Appium is an open source test automation framework for testing native, hybrid, and mobile web apps on iOS, Android, and Windows platforms. It uses the WebDriver protocol to drive apps similarly to how Selenium is used to test web apps. Docker can be used to run Appium and emulate devices for continuous integration of mobile tests without relying on physical devices or cloud services. Raspberry Pis with ZRAM modules allow running the Dockerized tests in parallel by emulating on the ARM-based Pis as Jenkins slaves.
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
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
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
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
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
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.
Building a High-Performance Distributed Task Queue on MongoDBMongoDB
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.
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.
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.
제2회 hello world 오픈세미나 hello world-raphael차트NAVER D2
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.
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 오픈세미나]실시간웹을위한comet과socket.ioNAVER D2
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.
머신러닝 및 데이터 과학 연구자를 위한 python 기반 컨테이너 분산처리 플랫폼 설계 및 개발Jeongkyu Shin
머신러닝 및 데이터 과학 분야의 컴퓨팅 수요는 해가 갈수록 급증하고 있습니다. 이와 더불어 분산처리 기술, 데이터 파이프라이닝 및 개발 환경 스택 관리 등의 관련된 다양한 이슈들 또한 엄청나게 늘어나고 있습니다. 머신러닝 모델의 기하급수적인 모델 복잡도 증가 추세와 마찬가지로, 모델 학습을 위한 환경 관리 또한 갈수록 복잡도가 높아지는 추세입니다.
이 세션에서는 이러한 문제를 해결하기 위해 python 언어 기반의 분산처리 스케쥴링/오케스트레이션 미들웨어 플랫폼을 개발한 4년간의 과정에서 겪은 다양한 문제들에 대해 다룹니다. 2015년 컨테이너 기반의 고밀도 분산처리 플랫폼 설계 및 프로토타이핑 과정을 PyCon KR에서 발표한 이후, 실제 구현 및 오픈소스화, 안정화를 거치며 겪은 다양한 기술적/비기술적 문제들에 대한 경험을 공유합니다.
기술적으로는 최근 몇 년 간의 클러스터 플랫폼 관련 기술의 진보와 함께 탄생한 다양한 도구들과, 이러한 도구들을 python 기반으로 엮어내기 위해 사용하고 개발한 다양한 오픈소스들을 다룹니다. Python 기반의 컨테이너 스케쥴링 및 오케스트레이션 과정의 구현과, 다양한 프로그래밍 언어로 만든 SDK를 graphQL을 이용하여 연동하는 과정에서의 몇몇 유의점을 설명합니다. 아울러 python 기반의 SDK를 다양한 언어로 포팅했던 경험을 간단하게 안내합니다.
플랫폼을 개발하는 중 등장한 TensorFlow, PyTorch 등의 다양한 머신러닝 프레임워크들을 도입하며 겪은 문제와 해결 과정에 대해서도 나눕니다. 연구 분야에는 Python 2.7 기반의 프레임워크들이 여전히 많습니다. 이러한 프레임워크 및 라이브러리의 지원을 위하여 Python 2 기반의 프레임워크와 Python 3.7로 구현한 컨테이너 인터페이스를 단일 컨테이너 환경에 중복 빌드 및 상호 간섭 없이 공존시키기 위해 개발한 아이디어를 소개합니다.
마지막으로 Python 기반의 프레임워크를 개발, 배포 및 상용화 하는 과정에서 겪은 다양한 어려움을 소개합니다. 솔루션을 배포 및 보급할 때 겪는 다양한 런타임, 하드웨어 환경 및 개인 정보 보호를 위한 폐쇄망 대상의 디플로이 등에 대응하기 위하여 Python 응용프로그램을 단독 실행용으로 패키징하는 과정에서 겪은 팁들을 설명합니다. 또한 GUI 빌드 및 Python, Go 및 C++을 함께 사용한 드라이버 가상화 레이어 개발 등의 내용도 살짝 다룹니다.
이 슬라이드는 PyCon KR 2019의 발표 슬라이드입니다. ( https://www.pycon.kr/program/talk-detail?id=138 )
The document discusses various machine learning clustering algorithms like K-means clustering, DBSCAN, and EM clustering. It also discusses neural network architectures like LSTM, bi-LSTM, and convolutional neural networks. Finally, it presents results from evaluating different chatbot models on various metrics like validation score.
The document discusses challenges with using reinforcement learning for robotics. While simulations allow fast training of agents, there is often a "reality gap" when transferring learning to real robots. Other approaches like imitation learning and self-supervised learning can be safer alternatives that don't require trial-and-error. To better apply reinforcement learning, robots may need model-based approaches that learn forward models of the world, as well as techniques like active localization that allow robots to gather targeted information through interactive perception. Closing the reality gap will require finding ways to better match simulations to reality or allow robots to learn from real-world experiences.
[243] Deep Learning to help student’s Deep LearningNAVER D2
This document describes research on using deep learning to predict student performance in massive open online courses (MOOCs). It introduces GritNet, a model that takes raw student activity data as input and predicts outcomes like course graduation without feature engineering. GritNet outperforms baselines by more than 5% in predicting graduation. The document also describes how GritNet can be adapted in an unsupervised way to new courses using pseudo-labels, improving predictions in the first few weeks. Overall, GritNet is presented as the state-of-the-art for student prediction and can be transferred across courses without labels.
[234]Fast & Accurate Data Annotation Pipeline for AI applicationsNAVER D2
This document provides a summary of new datasets and papers related to computer vision tasks including object detection, image matting, person pose estimation, pedestrian detection, and person instance segmentation. A total of 8 papers and their associated datasets are listed with brief descriptions of the core contributions or techniques developed in each.
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지NAVER D2
This document presents a formula for calculating the loss function J(θ) in machine learning models. The formula averages the negative log likelihood of the predicted probabilities being correct over all samples S, and includes a regularization term λ that penalizes predicted embeddings being dissimilar from actual embeddings. It also defines the cosine similarity term used in the regularization.
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기NAVER D2
The document discusses running a TensorFlow Serving (TFS) container using Docker. It shows commands to:
1. Pull the TFS Docker image from a repository
2. Define a script to configure and run the TFS container, specifying the model path, name, and port mapping
3. Run the script to start the TFS container exposing port 13377
The document discusses linear algebra concepts including:
- Representing a system of linear equations as a matrix equation Ax = b where A is a coefficient matrix, x is a vector of unknowns, and b is a vector of constants.
- Solving for the vector x that satisfies the matrix equation using linear algebra techniques such as row reduction.
- Examples of matrix equations and their component vectors are shown.
This document describes the steps to convert a TensorFlow model to a TensorRT engine for inference. It includes steps to parse the model, optimize it, generate a runtime engine, serialize and deserialize the engine, as well as perform inference using the engine. It also provides code snippets for a PReLU plugin implementation in C++.
The document discusses machine reading comprehension (MRC) techniques for question answering (QA) systems, comparing search-based and natural language processing (NLP)-based approaches. It covers key milestones in the development of extractive QA models using NLP, from early sentence-level models to current state-of-the-art techniques like cross-attention, self-attention, and transfer learning. It notes the speed and scalability benefits of combining search and reading methods for QA.
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
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();
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);
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) 단위 이다.
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