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 git@github.com: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";
const newFile = await convertToAudio(url, audioFileOutput);
System Architecture
Uses ffmpeg binary, and fluent ffmpeg to convert to audio, wav.
Development env
Node version is set in node version manager .nvmrc
Build
NA
Tests
NA
Deployment
npm run publish:public