@bbc/convert-to-audio
v1.2.0
Published
Node ffmpeg wrapper to convert audio or video file to an audio file that meets STT specs
Downloads
14
Maintainers
Keywords
Readme
Convert To Audio
Node ffmpeg wrapper to convert audio or video file to an audio file that meets STT specs
Originally from autoEdit2 and DPE
On npm @bbc/convert-to-audio
Setup
git clone [email protected]:bbc/convert-to-audio.git
cd convert-to-audio
npm install
Usage
npm install @bbc/convert-to-wav
const convertToAudio = require("@bbc/convert-to-wav");
const url = "https://download.ted.com/talks/KateDarling_2018S-950k.mp4";
const audioFileOutput = "./ted-talk.wav";
convertToAudio(url, audioFileOutput)
.then(newFile => {
console.log(newFile);
})
.catch(err => {
console.error(err);
});
Or with async await, inside an async block
const convertToAudio = require("@bbc/convert-to-wav");
const url = "https://download.ted.com/talks/KateDarling_2018S-950k.mp4";
const audioFileOutput = "./ted-talk.wav";
// inside an async function
const newFile = await convertToAudio(url, audioFileOutput);
System Architecture
Uses ffmpeg binary, and fluent ffmpeg to convert to audio, wav.
Development env
- npm >
6.1.0
- Node 10 - dubnium
Node version is set in node version manager .nvmrc
Build
NA
Tests
NA
Deployment
npm run publish:public