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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Translated from a MATLAB script (which also includes C-weighting, octave | |
and one-third-octave digital filters). | |
Author: Christophe Couvreur, Faculte Polytechnique de Mons (Belgium) | |
[email protected] | |
Last modification: Aug. 20, 1997, 10:00am. | |
BSD license |
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
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
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
var spawn = require('child_process').spawn; | |
exports.getPcmData = function(filename, sampleCallback, endCallback) { | |
var outputStr = ''; | |
var oddByte = null; | |
var channel = 0; | |
var gotData = false; | |
// Extract signed 16-bit little endian PCM data with ffmpeg and pipe to STDOUT | |
var ffmpeg = spawn('ffmpeg', ['-i',filename,'-f','s16le','-ac','2', |
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
let context = new AudioContext(); | |
let noiseWorker = context.createAudioWorker("worker.js"); | |
let noiseNode1 = context.createScriptProcessor(noiseWorker); | |
let noiseNode2 = context.createScriptProcessor(noiseWorker); | |
let oscillator = context.createOscillator(); | |
noiseNode1.connect(oscillator.detune); | |
noiseNode2.connect(context.destination); |