This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use llq::{Node, Queue}; | |
struct AudioRenderer { | |
is_real_node: bool, | |
garbage_collector: Option<llq::Producer<Self>>, | |
garbage_node: Option<llq::Node<Self>>, | |
} | |
impl AudioRenderer { | |
fn new(garbage_collector: llq::Producer<Self>) -> Self { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use web_audio_api::context::{AudioContext, AudioContextOptions, BaseAudioContext}; | |
use web_audio_api::media_devices; | |
use web_audio_api::media_devices::{enumerate_devices_sync, MediaDeviceInfo, MediaDeviceInfoKind}; | |
use web_audio_api::media_devices::{MediaStreamConstraints, MediaTrackConstraints}; | |
use web_audio_api::node::AudioNode; | |
fn ask_source_id() -> Option<String> { | |
println!("Enter the input 'device_id' and press <Enter>"); | |
println!("- Use 0 for the default audio input device"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple Linear Regression for 2 dimensionnal data | |
* | |
* @param {Array<Array>} observations - data | |
*/ | |
function simpleLinearRegression(observations) { | |
// means | |
let xSum = 0; | |
let ySum = 0; | |
const length = observations.length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Scheduler { | |
constructor(ctx, period = 0.025, lookahead = 0.1) { | |
this.queue = []; | |
this.ctx = ctx; | |
this.period = period; | |
this.lookahead = lookahead; | |
this.tick = this.tick.bind(this); | |
// @todo - launch only if there is somthing to do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title></title> | |
</head> | |
<body> | |
<button>play/pause</button> | |
<script> | |
var audioCtx = new AudioContext(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Transport Buttons</title> | |
<link rel="stylesheet" type="text/css" href="./transport-btns.css" /> | |
</head> | |
<body> | |
<code>Play/Pause Button</code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrthogonalData { | |
constructor() { | |
this._cols = null; // object of arrays | |
this._rows = null; // array of objects | |
} | |
// verify that data are consistents | |
_checkConsistency() { | |
let size = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>css</title> | |
<style> | |
a { | |
display: block; | |
border :1px solid #787878; | |
width: 300px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* find recursively in a given folder for a given pattern into file names | |
* returns an array of matching files | |
*/ | |
var fs = require('fs'), | |
path = require('path'), | |
util = require('util'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery' | |
], function($) { | |
'use strict'; | |
// extends $.support | |
// http://stackoverflow.com/questions/3937818/how-to-test-if-the-browser-supports-the-native-placeholder-attribute | |
$.support.placeholder = (function() { | |
var input = document.createElement( 'input' ); |
NewerOlder