Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert any mp3 file to .wav 16khz mono 16bit

Please, help to choose solution for converting any mp3 file to special .wav - I'm a newbie with Linux command line tools, so It's hard for me right now.

I need to get wav with 16khz mono 16bit sound properties from any mp3 file. I was trying

ffmpeg -i 111.mp3 -ab 16k out.wav,

but I got wav with the same rate as mp3 (22k).

Please, help to construct right command line

like image 935
Alve Avatar asked Nov 13 '12 09:11

Alve


People also ask

How do I change a WAV file to 16-bit?

Hit the gear icon right next to the audio file. Select the Audio section and choose WAV. Click on Settings again and choose the new bitrate for your WAV file. Click on Create to finalize the settings made.


2 Answers

kdazzle's solution is almost there - it still output a stereo wav, here is a slightly modified version that generate mono:

ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav 

also, if this is for pre-processing speech data for sphinx 4 see here: Convert audio files for CMU Sphinx 4 input

like image 189
Bill Avatar answered Sep 21 '22 17:09

Bill


Try this:

ffmpeg -i 111.mp3 -acodec pcm_s16le -ar 16000 out.wav 
like image 20
kdazzle Avatar answered Sep 23 '22 17:09

kdazzle