How to convert 16 bit wav to raw audio

I am trying to use sox to convert asterisk voicemail to raw audio. The encoding information for the original wav is PCM S16 LE, so I thought I could just make sox msg0000.wav msg0001.raw , but the raw file from it is distorted and, according to VLC, 4 minutes, compared to the 6-second source file.

I'm not sure where I am wrong, anyone, how to convert wav to raw? Sox is preferred, but any command line solution would be fine.

+1
source share
1 answer

Are you sure your problem is with sox, not VLC? I also had problems getting a VLC to play raw sound. There are command line options, but I do not quite understand how they work.

Before looking for another tool, make sure sox is really a problem by trying something like

 mplayer -rawaudio samplesize=2:channels=1:rate=8000 -demuxer rawaudio msg0001.raw 

In addition, sox can be provided with an additional parameter:

 sox msg0000.wav --bits 16 --encoding signed-integer --endian little msg0001.raw 

But I suspect these are the default settings, so they should not be needed.

+3
source

Source: https://habr.com/ru/post/959133/


All Articles