Discussion:
[SoX-users] batch sox process on a folder of files
Chris Pierpoint
2017-06-30 13:29:01 UTC
Permalink
Hello,



I use sox to simply resample wav-format files from 500 kHz to 48 kHz
sampling rate. I have a batch of 940 files to convert, but I can only do
about 100 files at a time because, I think, the number of characters in the
command line code exceeds a certain limit.



The batch file code is:

cd %~dp0

FOR %%A IN (%*) DO sox %%A "G:\LADC 2017 data\WAV48/%%~nxA" rate -v 48000

pause



Please can you show me how to execute the sox command on a whole folder of
files, so I don't have to drag the files onto the .bat file shortcut several
times. I just want to start the process and let it run.



The file folder path is:

G:\LADC 2017 data\WAV500



The destination folder for the converted files is:

G:\LADC 2017 data\WAV48



Could you also explain why it does not work when I drag files onto the batch
file (located in the sox.exe folder in the C:\Program (x86) Files\sox.? It
only works when i drag them onto a shortcut to the batch file on the
external G:\ drive.



Thanks v much,





Chris



---
This email has been checked for viruses by AVG.
http://www.avg.com
Jan Stary
2017-06-30 16:26:32 UTC
Permalink
Post by Chris Pierpoint
I use sox to simply resample wav-format files
from 500 kHz to 48 kHz sampling rate.
Can you please share how you obtain 500kHz srate audio and how you use them?
(Or why you convert them to 48kHz first?)

Jan
Chris Pierpoint
2017-06-30 17:11:55 UTC
Permalink
Hi Jan,

I sample my hydrophone array at 500 kHz, 2 ch, 16 bit using a National Instruments USB-6251 DAQ. This is when recording marine mammal echolocation. Some species click at high frequencies (e.g. harbour porpoise at 140 kHz), hence the high sampling rate. For some analyses when I don't need the higher frequencies, I resample at a lower rate because it's easier on PC resources and I can use shorter fast Fourier transform windows to look at spectrograms of the sounds in frequency domaine.

Chris

Sent from my iPhone
Post by Jan Stary
Post by Chris Pierpoint
I use sox to simply resample wav-format files
from 500 kHz to 48 kHz sampling rate.
Can you please share how you obtain 500kHz srate audio and how you use them?
(Or why you convert them to 48kHz first?)
Jan
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sox-users mailing list
https://lists.sourceforge.net/lists/listinfo/sox-users
Loading...