Skip to content

Instantly share code, notes, and snippets.

View cwilso's full-sized avatar
😃

Chris Wilson cwilso

😃
View GitHub Profile

Overview

In order to solve the "data race" issue in WebAudio (bug 22725), this proposal restricts access to the internal PCM data of an AudioBuffer. This does not require AudioBuffers to be immutable, but that modifying their contents occurs through an API which enforces no-data-race semantics.

Since this will involve breaking API changes, this proposal incorporates suggestions from Issue 48 to simplify the AudioBuffer interface, and will also adopt a constructor, as opposed to a factory method.

The new constructor provides an upgrade path for existing pages while not breaking those pages. The factory method can continue to create the "legacy" AudioBuffer in prefixed implementations.

Interface Changes

@darobin
darobin / controller.js
Last active December 12, 2015 07:48
Playing with implementing AppCache through the NavigationController
var fallbacks = {}
, networks = {}
, cacheName = "OldSchoolAppCache"
;
this.onmessage = function (e) {
var msg = e.data;
if (msg.type && msg.type === "manifest") {
var lines = msg.manifest.split(/\n+/)
, mode = "cache"
@stuartmemo
stuartmemo / Note to Frequency
Created September 22, 2012 15:00
Convert note to frequency
// Takes string of Note + Octave
// Example:
// var frequency = getFrequency('C3');
var getFrequency = function (note) {
var notes = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'],
octave,
keyNumber;
if (note.length === 3) {
@jlongster
jlongster / touch.css
Created September 11, 2012 19:20
Web Audio API demo (iOS 6, Chrome) - The Web is a Platform
html, body {
background-color: black;
width: 100%;
height: 100%;
margin: 0;
}
canvas {
display: block;
margin: 0;
@jussi-kalliokoski
jussi-kalliokoski / example.js
Created February 6, 2012 16:11
A simple proposal for the interfaces needed for useful MIDI access
// Example usage, a MIDI proxy that picks the first available MIDI input and routes its messages to the first MIDI outputs
navigator.getUserMedia({midi: true}, function (MIDIAccess) {
try {
var input = MIDIAccess.getInput(MIDIAccess.enumerateInputs()[0]);
var output = MIDIAccess.getOutput(MIDIAccess.enumerateInputs()[0]);
} catch (e) {
console.error("Couldn't find suitable MIDI devices");
}