linx-simulator2/node_modules/lame/examples/floatpcm2mp3.js

11 lines
370 B
JavaScript
Raw Normal View History

2019-09-18 08:11:16 +00:00
var fs = require('fs');
var lame = require('../');
var path = require('path');
fs.createReadStream(process.argv[2] || path.resolve(__dirname, 'sample.float.pcm'))
.pipe(new lame.Encoder({ channels: 2, bitDepth: 32, float: true }))
.pipe(fs.createWriteStream(path.resolve(__dirname, 'sample_pcm.mp3')))
.on('close', function () {
console.error('done!');
});