I realize that this forum is about Audacity, but many users here seem familiar with SoX, so I thought I would ask my question here.
I’m doing some work using an 8 bit MCU to take PCM uLaw data from an SD card, converts it back to signed 14 bit linear, adds a DC offset and sends it to a DAC which then goes to an amplified speaker. That all works as expected.
I create my source audio files (human voice saying words and phrases) in Audacity as 44100 s/s WAV files. I then use SoX to convert the WAV files to 8 bit uLaw PCM. I use the following script on the Windows 10 command line (SoX is in my PATH, the WAV file is not in the SoX executable directory):
sox.exe input.wav -r 8000 -b 8 output.raw remix -
I know little about SoX but this seems to work (the output.raw file sounds good to the ear when listening to the amplified speaker, after the MCU converts 8 bit uLaw back to 14 bit signed linear with DC offset).
My problem comes when I want to generalize my command line script to convert a bunch of WAV files to PCM files, i.e., batch process.
I found this website that discusses batch processing with SoX
https://madskjeldgaard.dk/posts/sox-tutorial-batch-processing/
which gives examples. One example is to normalize a bunch of WAV files using:
for file in *.wav; do sox “$file” “n_$file” norm -0.1; done
My problem is that when I run this on the Windows 10 command line I get the following response:
file was unexpected at this time.
P:\cstuff\SoX_>for file in *.wav; do sox “$file” “n_$file” norm -0.1; done
This is probably some sort of syntax problem, but I haven’t been able to figure it out.
Any guidance or suggestions would be very welcome.
Paul