Re: BatchProcessing Files on Windows

Nils Wallgren <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <HE1PR0102MB32252AF5812C1D010E2A2B4AAA8F0@HE1PR0102MB3225.eurprd01.prod.exchangelabs.com>
Thanks so much for the help. I guess a lot of the things were kind of basic and made it confusing what I was asking for. I am really glad I got it to work


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Jeff Learman<mailto:[email protected]>
Sent: Thursday, 28 May 2020 16:19
To: [email protected]<mailto:[email protected]>
Subject: Re: [SoX-users] BatchProcessing Files on Windows

BTW, if you have more Windows cmd issues, I highly recommend joining and asking at http://stackoverflow.com which is a better place for generic questions.  Of course, at first you didn't know whether your issues were sox issues (and one of them was.)  Just pointing out a great resource for that kind of question.  They can also answer sox questions there.

On Thu, 28 May 2020 at 10:07, Jeff Learman <[email protected]<mailto:[email protected]>> wrote:
%%~Ni returns the base filename (without directory or extension) for %%i, if %%i is the index in a FOR loop.  See https://stackoverflow.com/questions/3432851/dos-bat-file-equivalent-to-unix-basename-command for more info.  Look at the second answer down, which has a list for what "%~xi" does for different letters x.  Apparently it's case-insensitive.  Also, the for is different in a batch file than on the command line, "%%" versus "%", see https://stackoverflow.com/questions/14509652/what-is-the-difference-between-and-in-a-cmd-file for the reason.  (I'll just add that to the list of reasons I dislike Windows command line.  But the main reason is I'm more used to sh/ksh/bash.)

On Thu, 28 May 2020 at 01:36, [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> wrote:
If the place of Sox is "C:\Program Files (x86)\Sox\sox.exe", you could
also start your command in your wav-folder:

FOR %F IN (*.wav) DO "C:\Program Files (x86)\Sox\sox.exe" "%F" -b 8
"%~NF.aiff"

or

FOR %F IN (*.wav) DO "C:\Program Files (x86)\Sox\sox.exe" "%F" -b 8
"processedfolder\%~NF.flac"

*.cmd means a batch file. I have attached such a file ("command.txt"):
- copy it inside your wav-folder
- if necessary do any changes
- inside a cmd-file you need double "%"
- rename it to "command.cmd" and make a double-click :-)

Regards
Thomas


Am 27.05.2020 um 15:33 schrieb Nils Wallgren:
> I have my sox.exe in in my Program Files (x86). What I always do is 1)
> open the folder that contains the audiofiles, write the “cmd” in the
> address field
>
> 2) set the audiodriver=waveaudio
>
> 3) then I use sox/play/rec
>
> I don’t know any other way to work.
>
> Sorry. But when you write *.cmd I am not really sure where to run this
> command.
>
> I tried my workprocess with FOR %F IN (*.wav) DO sox.exe "%F" -b 8
> "processedfolder\%~NF.flac" and it works
>
> But not really sure what the ~NF is short for.
>
> If I work within the folder of Sox I also need to place the audiofiles
> in this folder too.
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
> *From: *[email protected]<mailto:[email protected]> <mailto:[email protected]<mailto:[email protected]>>
> *Sent: *Wednesday, 27 May 2020 14:31
> *To: *Nils Wallgren <mailto:[email protected]<mailto:[email protected]>>
> *Cc: *[email protected]<mailto:[email protected]>
> <mailto:[email protected]<mailto:[email protected]>>
> *Subject: *Re: [SoX-users] BatchProcessing Files on Windows
>
> This is a fake sox-path :-) You must use ure own path!!! Where is your
> sox. exe? Or do you start the batch file or command inside the folder of
> Sox, where the sox.exe is?
>
> This should work - commandline (if you have flac inside):
> FOR %F IN (*.wav) DO sox.exe "%F" -b 8 "%~NF.flac"
>
> Or in a *.cmd:
> FOR %%F IN (*.wav) DO sox.exe "%%F" -b 8 "%%~NF.flac"
>
> Regards
> Thomas
>
> Am 27.05.2020 um 11:48 schrieb Nils Wallgren:
>
>     “C:\sox.exe"' is not recognized as an internal or external command”
>
_______________________________________________
Sox-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/sox-users

_______________________________________________
Sox-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sox-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.