batch sox process on a folder of files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

batch sox process on a folder of files

Chris Pierpoint

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


Virus-free. www.avg.com

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: batch sox process on a folder of files

Jan Stary
On Jun 30 14:29:01, [hidden email] wrote:
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: batch sox process on a folder of files

Chris Pierpoint
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

> On 30 Jun 2017, at 17:26, Jan Stary <[hidden email]> wrote:
>
>> On Jun 30 14:29:01, [hidden email] wrote:
>> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users