Install sox tool with mp3 support:
apt-get install sox apt-get install libsox-fmt-mp3 sox file.mp3 file.wav
Basically that is all, but if you need to check resulting wav file parameters like channels, sample rate, precision, duration, bit rate, etc…, use soxi command:
soxi file.wav
With my wav file, it shows the following:
Input File : ’emergency.wav’
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:00:28.94 = 1276416 samples = 2170.78 CDDA sectors
File Size : 5.11M
Bit Rate : 1.41M
Sample Encoding: 16-bit Signed Integer PCM
to play wav file type
play file.wav
File Size: 5.11M Bit Rate: 1.41M
Encoding: Signed PCM
Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
Duration: 00:00:28.94In:12.5% 00:00:03.62 [00:00:25.32] Out:160k [ -====|====- ] Hd:5.6 Clip:0
Links:
- SoX Documentation
- Audio manipulation with SoX
- SoX Examples (Probably not all examples are correct here, to change bit rate I did: sox sound16bit.wav -b 32 sound32bit.wav)
- Beautiful picture describing WAV header
- WAVE PCM soundfile format
- WAVE 24 and 32 bit should play on Ubuntu with GStreamer by default
On CentOS, Nux Dextop requires EPEL repository, so I enabled all the repositories in /etc/yum.repos.d/epel.repo.
convert all the files in the current directory:
for f in *; do sox $f ${f%.*}.wav; done;
Reducing sound volume:
sox -v 0.9 in.wav out.wav