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, "rb")
I searched on the Internet, and it looks like the problem is that "wave" 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 "sox" program:
find . -name '*.wav' | xargs -I@ bash -c "sox @ @"
The command reads though all of my ".wav" 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 "wave" library?
EDIT: Also, now I noticed, that when I apply the sox command to only one file, the file is converted to "RIFF" 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!