HydrogenAudio

Lossy Audio Compression => Other Lossy Codecs => Topic started by: ninjawarrior on 2010-01-18 12:55:13

Title: Convert any audio to CCITT .wav format
Post by: ninjawarrior on 2010-01-18 12:55:13
Well I have requirement of converting any audio file in .wav/.mp3 format to following format

The destination file format is different in windows and in linux

in windows it shows:
64kbps, 8bit mono, 8khz, CCITT A-Law

in linux it shows:
RIFF (little-endian) data, WAVE audio, 20294 channels 1413894985 Hz

The question is why in different operating system same audio file is shown in different format and while converting any wav file or mp3 file what should be my destination file format.

As I am working in linux, let me choose linux format, so how can I convert any .wav file / .mp3 file in the above written LINUX sound file format.

I tried LAME but its not working.
Title: Convert any audio to CCITT .wav format
Post by: trout on 2010-01-18 19:00:50
try SoX (http://sox.sourceforge.net/Main/HomePage)
(you might also need libmad to decode mp3)

command: sox input.wav -A -c 1 -r 8000 output.wav
Title: Convert any audio to CCITT .wav format
Post by: ninjawarrior on 2010-01-19 09:43:18
try SoX (http://sox.sourceforge.net/Main/HomePage)
(you might also need libmad to decode mp3)

command: sox input.wav -A -c 1 -r 8000 output.wav



I tried this but it says
sox formats: can't open input file `input.wav': WAVE: RIFF header not found

I have libmad installed, both devel version and original one on the linux box.
Title: Convert any audio to CCITT .wav format
Post by: trout on 2010-01-19 16:38:26
Quote from: ninjawarrior link=msg=0 date=
can't open input file `input.wav': WAVE: RIFF header not found

if the input has no header, then you need to specify the file type

sox -t <file-type> -e <data-encoding> -b <bits> -r <sample-rate> -c <channels> input.wav -A -r 8000 -c 1 output.wav

man page - http://sox.sourceforge.net/sox.html (http://sox.sourceforge.net/sox.html)
Title: Convert any audio to CCITT .wav format
Post by: ninjawarrior on 2010-01-20 17:48:04
Thank you , it worked.