29 lines
871 B
Markdown
29 lines
871 B
Markdown
|
# prism-media
|
||
|
[](https://travis-ci.org/hydrabolt/prism-media)
|
||
|
[](https://david-dm.org/hydrabolt/prism-media)
|
||
|
[](https://david-dm.org/hydrabolt/prism-media?type=dev)
|
||
|
|
||
|
Makes programmatically transcoding media easier
|
||
|
|
||
|
`npm install --save hydrabolt/prism-media`
|
||
|
|
||
|
```js
|
||
|
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'));
|
||
|
```
|