From: Jeff Learman <jjlearman@gmail.com>
To: sox-users@lists.sourceforge.net
Subject: Re: BatchProcessing Files on Windows
Date: Thu, 28 May 2020 10:07:16 -0400 [thread overview]
Message-ID: <CAGyjer5OoLtmmRcPfq_yvc9wB5b=ief8Skn1bLotKKefTQn+8A@mail.gmail.com> (raw)
In-Reply-To: <13d91385-87d0-635e-aa10-5a0cdbe11b50@web.de>
[-- Attachment #1.1: Type: text/plain, Size: 3260 bytes --]
%%~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, tsepp2000@web.de <tsepp2000@web.de> 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: *tsepp2000@web.de <mailto:tsepp2000@web.de>
> > *Sent: *Wednesday, 27 May 2020 14:31
> > *To: *Nils Wallgren <mailto:affarer@hotmail.com>
> > *Cc: *sox-users@lists.sourceforge.net
> > <mailto:sox-users@lists.sourceforge.net>
> > *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
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>
[-- Attachment #1.2: Type: text/html, Size: 4896 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
[-- Attachment #3: Type: text/plain, Size: 158 bytes --]
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users
next prev parent reply other threads:[~2020-05-28 14:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 22:30 BatchProcessing Files on Windows Nils Wallgren
2020-05-27 0:21 ` Jeff Learman
2020-05-27 8:09 ` Nils Wallgren
[not found] ` <173dc6c3-ff96-e8b7-a072-3d3f84220e5d@bayern-mail.de>
2020-05-27 8:34 ` tsepp2000
2020-05-27 9:48 ` Nils Wallgren
2020-05-27 12:31 ` tsepp2000
[not found] ` <HE1PR0102MB3225333E72970AB67FB1D914AAB10@HE1PR0102MB3225.eurprd01.prod.exchangelabs.com>
2020-05-28 5:35 ` tsepp2000
2020-05-28 14:07 ` Jeff Learman [this message]
2020-05-28 14:17 ` Jeff Learman
2020-05-29 12:24 ` Nils Wallgren
2020-05-28 5:53 ` tsepp2000
2020-05-27 12:50 ` Jeff Learman
2020-05-27 12:55 ` Jeff Learman
2020-05-27 12:20 ` Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.sourceforge.net/lists/listinfo/sox-users
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGyjer5OoLtmmRcPfq_yvc9wB5b=ief8Skn1bLotKKefTQn+8A@mail.gmail.com' \
--to=sox-users@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/sox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).