Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sox - Converting files Sample rate not specified

Tags:

audio

wav

sox

This is a follow up question from: wac-to-wav-conversion

I have changed the file extension from .wac to .raw and used the following command:

sox -r 44100 -e unsigned -b 8 -c 1 input.raw output.wav

This converts to the .wav file, however distorts the sound massively, for example:

enter image description here

Where it should be the following:

enter image description here

There is a massive difference and I can't seem to figure out where it is I am going wrong. I have also tried the following:

sox input.raw --bits 16 --encoding signed-integer --endian little 
output.wav

But I just get the following:

sox FAIL formats: bad input format for file `input.raw': sampling rate was not specified

Does anyone know of a way to set the sampling rate, so the file is correct?

like image 817
Phorce Avatar asked Nov 13 '13 13:11

Phorce


1 Answers

It's hard to tell from the graphs, but maybe the raw file is signed data? Just change "-e unsigned" to "-e signed". You could also try with different sample widths, i.e. "-b 16" or "-b 32".

like image 98
anon Avatar answered Nov 13 '22 01:11

anon