Haha-Yes/node_modules/prism-media
2018-09-07 00:24:03 +02:00
..
src haha yes 2018-09-06 15:02:53 +02:00
test haha yes 2018-09-06 15:02:53 +02:00
.eslintrc.json haha yes 2018-09-06 15:02:53 +02:00
.travis.yml haha yes 2018-09-06 15:02:53 +02:00
LICENSE haha yes 2018-09-06 15:02:53 +02:00
output.opus haha yes 2018-09-06 15:02:53 +02:00
package.json Rewrite of the whole bot 2018-09-07 00:24:03 +02:00
README.md haha yes 2018-09-06 15:02:53 +02:00

prism-media

Build Status dependencies devDependencies

Makes programmatically transcoding media easier

npm install --save hydrabolt/prism-media

const Prism = require('prism-media');
const fs = require('fs');

const prism = new Prism();

const transcoder = prism.transcode({
  type: 'ffmpeg',
  media: './test/test.mp3',
  ffmpegArguments: [
    '-analyzeduration', '0',
    '-loglevel', '0',
    '-f', 's16le',
    '-ar', '48000',
    '-ac', '2',
  ],
});

transcoder.output.pipe(fs.createWriteStream('./test/test.pcm'));