Created
April 11, 2018 07:23
-
-
Save d3x0r/f981151314de87f038bb9829dc0b474a to your computer and use it in GitHub Desktop.
promisfy this?
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 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