How to change mp3 file to wav file in node.js

I am trying to convert an mp3 file to a wav file, but I don’t understand how to do it, I tried to use the fluent-ffmpeg library, but I don’t know how to use it.

+7
fluent-ffmpeg
source share
1 answer

I finally figured this out using the fluent-ffmpeg library. Here is my code.

var ffmpeg = require('fluent-ffmpeg'); var track = './source.mp3';//your path to source file ffmpeg(track) .toFormat('wav') .on('error', function (err) { console.log('An error occurred: ' + err.message); }) .on('progress', function (progress) { // console.log(JSON.stringify(progress)); console.log('Processing: ' + progress.targetSize + ' KB converted'); }) .on('end', function () { console.log('Processing finished !'); }) .save('./hello.wav');//path where you want to save your file 
+8
source share

All Articles