Skip to content

Instantly share code, notes, and snippets.

@d3x0r
Created April 11, 2018 07:23
Show Gist options
  • Save d3x0r/f981151314de87f038bb9829dc0b474a to your computer and use it in GitHub Desktop.
Save d3x0r/f981151314de87f038bb9829dc0b474a to your computer and use it in GitHub Desktop.
promisfy this?
var lame = require( "lame" )
, Speaker = require('speaker')
var sack = require( "../node_modules/sack-gui" )
var disk = sack.Volume();
["Click-SoundBible.com-1387633738.mp3"
,"Cracking Chest Open-SoundBible.com-2009973824.mp3"
,"dclick.mp3"
,"handcuffs-daniel_simon.mp3"
,"Pop Clip In-SoundBible.com-5837465732.mp3"
,"Stapler-SoundBible.com-374581609.mp3"].forEach( file=>{
var ld = new lame.Decoder();
ld.on('format', function (format) { ld.pipe( new Speaker(format) ) } );
ld.write( new Uint8Array(disk.read( "../sounds/" + file ) ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment