Menu

#353 Recording 24/32 bits audio not in proper wave format

closed
nobody
None
5
2021-05-05
2021-05-03
No

I am working on a project that consists of characterizing the audio of commercial devices (eg. laptops and tablets). In order to do so, I need to record audio with the devices and I have selected sox for PCs running Windows 10. I am using sox version 14.4.1 and running the following command:

“sox -L -c 2 -e signed -b 24 -r 48000 recording_X.wav trim 0:01 0:10 ”

If I use 24 (or 32) for bit-depth as in the command above, I get the following running "file X" on unix system:

RIFF (little-endian) data, WAVE audio, stereo 48000 Hz

If I use 16 bits, I get:

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz

The 3 generated wave files can be played by Audacity but only the 16 bits version seems to be in the right wave format. This is causing me issues as I wanted to use 24 bits and perform post-processing in Python (wave.py).

Discussion

  • Mans Rullgard

    Mans Rullgard - 2021-05-04

    Implementations disagree regarding the correct header values for 24/32-bit PCM. If the SoX default doesn't work, try using the -t wavpcm option for the output file.

     
    👍
    1
  • Leonardo Martinez

    Perfect, thanks for the clarification. After digging into the code I found out that sox was using the "Extensible" format. I was not aware of the wavpcm format option... It is working now and makes sense!

     
  • Mans Rullgard

    Mans Rullgard - 2021-05-05
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB