Audio Conversion

Async Audio Conversion#

Async Audio API supports files of either .wav or .mp3 and the file must have mono-channel audio only. Any other file formats can be converted using the code snippet from FFmpeg

$ npm install --save fluent-ffmpeg

The below snippet shows how you can convert a file from .mp4 to .mp3 using the fluent-ffmpeg node module

const ffmpeg = require('fluent-ffmpeg');
ffmpeg('/my/path/to/original/file.mp4')
.format('mp3')
.on('end', () => {
console.log('end');
})
.on('error', (err) => {
// error
})
.save('/path/to/output/file.mp3');