I am running these code in localhost just testing out Microsoft Azure speech recognition. The idea is to record my voice using my headset, then use FFmpeg to convert the data to WAV format and send the audio to Microsoft Azure. But again and again, FFmpeg gave me this error saying the Output format wav is not available.
I tried to do this manually on command prompt without any problem:
ffmpeg -i input.mp3 -acodec pcm_s16le -ar 16000 -ac 1 output.wav
I tried to run the FFmpeg in the code without the toFormat function without any problem:
// Convert MP3 to WAV
ffmpeg('testing1.mp3')
.output('output.wav')
.on('end', function() {
console.log('Conversion to WAV completed');
})
.on('error', function(err) {
console.error('Error:', err);
})
.run();
These confirm that the ffmpeg was installed correctly. But as long as I start running the code as below, it kept telling me output format wav is not available. I tried calling getAvailableFormats, and it returns an empty array.
I installed all the packages this week (May 2024), so all the versions should be up-to-date.
(note: if the problem only happens with some inputs, include a link to such an input file)
Expected results
MP3 being recorded by mic and converted to WAV format by ffmpeg and submit to Microsoft Azure Speech Recognition for transcription
Observed results
FFmpeg Error: Error: Output format wav is not available
FFmpeg Error: Error: Output format wav is not available
at C:\Users\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21
at nextTask (C:\Users\node_modules\async\dist\async.js:5791:13)
at next (C:\Users\node_modules\async\dist\async.js:5799:13)
at C:\Users\node_modules\async\dist\async.js:329:20
at C:\Users\fluent-ffmpeg\lib\capabilities.js:549:7
at handleExit (C:\Users\aaron\liveatc_transcriber\node_modules\fluent-ffmpeg\lib\processor.js:170:11)
at ChildProcess. (C:\Users\aaron\liveatc_transcriber\node_modules\fluent-ffmpeg\lib\processor.js:184:11)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
FFmpeg Stderr: undefined
[x] I tried the same with command line ffmpeg and it works correctly (hint: if the problem also happens this way, this is an ffmpeg problem and you're not reporting it to the right place)
[x] I have included full stderr/stdout output from ffmpeg
I am running these code in localhost just testing out Microsoft Azure speech recognition. The idea is to record my voice using my headset, then use FFmpeg to convert the data to WAV format and send the audio to Microsoft Azure. But again and again, FFmpeg gave me this error saying the Output format wav is not available.
I tried to do this manually on command prompt without any problem: ffmpeg -i input.mp3 -acodec pcm_s16le -ar 16000 -ac 1 output.wav
I tried to run the FFmpeg in the code without the toFormat function without any problem: // Convert MP3 to WAV ffmpeg('testing1.mp3') .output('output.wav') .on('end', function() { console.log('Conversion to WAV completed'); }) .on('error', function(err) { console.error('Error:', err); }) .run();
These confirm that the ffmpeg was installed correctly. But as long as I start running the code as below, it kept telling me output format wav is not available. I tried calling getAvailableFormats, and it returns an empty array.
I installed all the packages this week (May 2024), so all the versions should be up-to-date.
Please help!
Version information
Code to reproduce
(note: if the problem only happens with some inputs, include a link to such an input file)
Expected results
MP3 being recorded by mic and converted to WAV format by ffmpeg and submit to Microsoft Azure Speech Recognition for transcription
Observed results
FFmpeg Error: Error: Output format wav is not available
FFmpeg Error: Error: Output format wav is not available at C:\Users\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21 at nextTask (C:\Users\node_modules\async\dist\async.js:5791:13) at next (C:\Users\node_modules\async\dist\async.js:5799:13) at C:\Users\node_modules\async\dist\async.js:329:20 at C:\Users\fluent-ffmpeg\lib\capabilities.js:549:7 at handleExit (C:\Users\aaron\liveatc_transcriber\node_modules\fluent-ffmpeg\lib\processor.js:170:11) at ChildProcess. (C:\Users\aaron\liveatc_transcriber\node_modules\fluent-ffmpeg\lib\processor.js:184:11)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
FFmpeg Stderr: undefined
Checklist