Skip to content

Instantly share code, notes, and snippets.

@jussi-kalliokoski
jussi-kalliokoski / main.js
Created May 12, 2014 07:45
Web Audio Worker Example - Shared Parallel
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);
@jhurliman
jhurliman / audioExtractor.js
Created March 1, 2012 23:09
Read PCM (WAV) data with node.js
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',
@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 27, 2024 01:24 — forked from endolith/peakdet.m
Peak detection in Python
#!/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
@endolith
endolith / A_weighting.py
Last active May 28, 2024 16:55
A-weighting audio files in Python
#!/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)
couvreur@thor.fpms.ac.be
Last modification: Aug. 20, 1997, 10:00am.
BSD license