How to convert NIST to RIFF wav file I have a dataset of audios(namely TIDIGITS, collected at Texas Instruments, Inc.) and they are in .wav format. However, when I try to read them from python, I get the following error:
Error: file does not start with RIFF id

Error is thrown from the following line:
import wave
...
f = wave.open(/path/to/audio/example.wav, &quot;rb&quot;)

I searched on the Internet, and it looks like the problem is that &quot;wave&quot; library does not support NIST formats and the audio are in the NIST SPHERE format, according to the dabaset's website:
https://catalog.ldc.upenn.edu/ldc93s10
So I transformed them into .wav using &quot;sox&quot; program:
find . -name '*.wav' | xargs -I@ bash -c &quot;sox @ @&quot;

The command reads though all of my &quot;.wav&quot; files and then applies
sox name.wav name.wav

to transform them to RIFF format.
However, now when I play the files in my media player, I get no sound.
The waveform of the audio becomes as follows:

Where it should be something like this:

I think the problem lies at the sox command.
Can anyone help me to convert all of my data to a RIFF format, so that I could read them from the &quot;wave&quot; library?
EDIT: Also, now I noticed, that when I apply the sox command to only one file, the file is converted to &quot;RIFF&quot; format and the waveform is similar to the second image, however when I apply them to all of them with the above described command, the audios loose their sound.
Thank you in advance!
OK, I solve the problem. The problem was that I was overriding the files when I used the "sox" command, as I want them to convert into RIFF format. However, "sox" didn't convert them correctly when using the same file name, i.e. when overriding the files. When I changed the file name of the overridden files, it converted them into RIFF format.