sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* BatchProcessing Files on Windows
@ 2020-05-26 22:30 Nils Wallgren
  2020-05-27  0:21 ` Jeff Learman
  2020-05-27 12:20 ` Måns Rullgård
  0 siblings, 2 replies; 14+ messages in thread
From: Nils Wallgren @ 2020-05-26 22:30 UTC (permalink / raw)
  To:   sox-users@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 635 bytes --]

I have some problems getting these things to work:

1 I want the duration of a couple of soundfiles in a directory

sox --i -D kick_*.wav

the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
but it doesn’t work with the wildcard.

2 If I want to batch process a couple of files in a directory and process/convert them to something else
And put the processed files in a new folder, how do I do that?

for %i in *.wav do sox "%i" -b 8  "n_%i" .flac

(also not sure of the conversion of the files when batching)

Best,

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


[-- Attachment #1.2: Type: text/html, Size: 2921 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  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
  2020-05-27 12:20 ` Måns Rullgård
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Learman @ 2020-05-27  0:21 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 1461 bytes --]

For the first question, I'll let the devs answer, but apparently sox
doesn't batch.

For the second question, that's not a sox issue; it's a scripting
question.  What shell are you using?  For bash:

for F in *.wav ; do
    sox $F -b 8 mydir/$F
done

I'm guessing you use Windows CLI?  For that I'd use this:
https://ss64.com/nt/for2.html -- so it looks like you just need %% instead
of %, and a backslash between the dir name and the wave file name.

Jeff




On Tue, 26 May 2020 at 18:31, Nils Wallgren <affarer@hotmail.com> wrote:

> I have some problems getting these things to work:
>
>
>
> 1 I want the duration of a couple of soundfiles in a directory
>
>
>
> sox --i -D kick_*.wav
>
>
>
> the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
>
> but it doesn’t work with the wildcard.
>
>
>
> 2 If I want to batch process a couple of files in a directory and
> process/convert them to something else
>
> And put the processed files in a new folder, how do I do that?
>
>
>
> for %i in *.wav do sox "%i" -b 8  "n_%i" .flac
>
>
>
> (also not sure of the conversion of the files when batching)
>
>
>
> Best,
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

[-- Attachment #1.2: Type: text/html, Size: 3367 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  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 12:50     ` Jeff Learman
  0 siblings, 2 replies; 14+ messages in thread
From: Nils Wallgren @ 2020-05-27  8:09 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 2780 bytes --]

Thanks for the reply. I am using windows 10 command prompt. Maybe not optimal but It’s kind of hard to know
which one to use if your not an experienced programmer. I have Git Bash, is this is what you mean? But I don’t use it
because I can’t get the set audiodriver to work as I could in the command prompt. In cmd.exe this is the first thing I do
set audiodriver=waveaudio and I am ready to go. I guess there is a simple way to set up this from bash but
I havn’t found any answer. The amount of questions quickly escalates

When I ran your first script inside bash it didn’t work
Just to make things clear:
I ran this inside of Git Bash from a chosen folder set as my cd
I also have to create a new folder within in this cd with mkdir?

Then I’ll use for F in *.wav ; do
    sox $F -b 8 nameoffolder/$F
done

But It doesn’t work

But It would be nice to run it inside Command Prompt in windows 10.
I have been using sox in with cmd.exe because it worked for but most information I find using sox is on Linux
So maybe I should switch..


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

From: Jeff Learman<mailto:jjlearman@gmail.com>
Sent: Wednesday, 27 May 2020 02:23
To: sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
Subject: Re: [SoX-users] BatchProcessing Files on Windows

For the first question, I'll let the devs answer, but apparently sox doesn't batch.

For the second question, that's not a sox issue; it's a scripting question.  What shell are you using?  For bash:

for F in *.wav ; do
    sox $F -b 8 mydir/$F
done

I'm guessing you use Windows CLI?  For that I'd use this: https://ss64.com/nt/for2.html -- so it looks like you just need %% instead of %, and a backslash between the dir name and the wave file name.

Jeff




On Tue, 26 May 2020 at 18:31, Nils Wallgren <affarer@hotmail.com<mailto:affarer@hotmail.com>> wrote:
I have some problems getting these things to work:

1 I want the duration of a couple of soundfiles in a directory

sox --i -D kick_*.wav

the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
but it doesn’t work with the wildcard.

2 If I want to batch process a couple of files in a directory and process/convert them to something else
And put the processed files in a new folder, how do I do that?

for %i in *.wav do sox "%i" -b 8  "n_%i" .flac

(also not sure of the conversion of the files when batching)

Best,

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

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net<mailto:Sox-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/sox-users


[-- Attachment #1.2: Type: text/html, Size: 9535 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
       [not found]     ` <173dc6c3-ff96-e8b7-a072-3d3f84220e5d@bayern-mail.de>
@ 2020-05-27  8:34       ` tsepp2000
  2020-05-27  9:48         ` Nils Wallgren
  0 siblings, 1 reply; 14+ messages in thread
From: tsepp2000 @ 2020-05-27  8:34 UTC (permalink / raw)
  To: sox-users

[-- Attachment #1: Type: text/html, Size: 9343 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-27  8:34       ` tsepp2000
@ 2020-05-27  9:48         ` Nils Wallgren
  2020-05-27 12:31           ` tsepp2000
  0 siblings, 1 reply; 14+ messages in thread
From: Nils Wallgren @ 2020-05-27  9:48 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 4450 bytes --]

I don’t think the .cmd lets me use %%:
“%%a was unexpected at this time”
Also:
“C:\sox.exe"' is not recognized as an internal or external command”

What I want to do is convert files within a cd using wildcards *.wav converting these to another fileformat i.e flac while also giving it its name and create the processed
In a new folder within the cd.

This is the closest I get but the naming is kind of strange
Mkdir converted
For %i in (*.wav) do sox "%i" -b 8  "converted/name_%i.flac

babar.wav  (original fil)

n_babar.wav.flac (new file)
would be nice to just have the n_babar.flac






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 10:36
To: sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
Subject: Re: [SoX-users] BatchProcessing Files on Windows

Hi,

I don't understand exactly, what you want to do. And it's not very different using sox with linux. May be this could help? This could be a *.cmd:

for %%a in (*.wav) do "C:\sox.exe" [...] "%%a"
pause

After sox you could give in your [paramters].

Regards
Thomas






-------- Weitergeleitete Nachricht --------
Betreff:
Re: [SoX-users] BatchProcessing Files on Windows
Datum:
Wed, 27 May 2020 08:09:29 +0000
Von:
Nils Wallgren <affarer@hotmail.com><mailto:affarer@hotmail.com>
Antwort an:
sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
An:
sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net> <sox-users@lists.sourceforge.net><mailto:sox-users@lists.sourceforge.net>

Thanks for the reply. I am using windows 10 command prompt. Maybe not optimal but It’s kind of hard to know
which one to use if your not an experienced programmer. I have Git Bash, is this is what you mean? But I don’t use it
because I can’t get the set audiodriver to work as I could in the command prompt. In cmd.exe this is the first thing I do
set audiodriver=waveaudio and I am ready to go. I guess there is a simple way to set up this from bash but
I havn’t found any answer. The amount of questions quickly escalates

When I ran your first script inside bash it didn’t work
Just to make things clear:
I ran this inside of Git Bash from a chosen folder set as my cd
I also have to create a new folder within in this cd with mkdir?

Then I’ll use for F in *.wav ; do
    sox $F -b 8 nameoffolder/$F
done

But It doesn’t work

But It would be nice to run it inside Command Prompt in windows 10.
I have been using sox in with cmd.exe because it worked for but most information I find using sox is on Linux
So maybe I should switch..


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

From: Jeff Learman<mailto:jjlearman@gmail.com>
Sent: Wednesday, 27 May 2020 02:23
To: sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
Subject: Re: [SoX-users] BatchProcessing Files on Windows

For the first question, I'll let the devs answer, but apparently sox doesn't batch.

For the second question, that's not a sox issue; it's a scripting question.  What shell are you using?  For bash:

for F in *.wav ; do
    sox $F -b 8 mydir/$F
done

I'm guessing you use Windows CLI?  For that I'd use this: https://ss64.com/nt/for2.html -- so it looks like you just need %% instead of %, and a backslash between the dir name and the wave file name.

Jeff




On Tue, 26 May 2020 at 18:31, Nils Wallgren <affarer@hotmail.com<mailto:affarer@hotmail.com>> wrote:
I have some problems getting these things to work:

1 I want the duration of a couple of soundfiles in a directory

sox --i -D kick_*.wav

the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
but it doesn’t work with the wildcard.

2 If I want to batch process a couple of files in a directory and process/convert them to something else
And put the processed files in a new folder, how do I do that?

for %i in *.wav do sox "%i" -b 8  "n_%i" .flac

(also not sure of the conversion of the files when batching)

Best,

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

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net<mailto:Sox-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/sox-users



[-- Attachment #1.2: Type: text/html, Size: 21443 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-26 22:30 BatchProcessing Files on Windows Nils Wallgren
  2020-05-27  0:21 ` Jeff Learman
@ 2020-05-27 12:20 ` Måns Rullgård
  1 sibling, 0 replies; 14+ messages in thread
From: Måns Rullgård @ 2020-05-27 12:20 UTC (permalink / raw)
  To: Nils Wallgren; +Cc:  sox-users@lists.sourceforge.net

Nils Wallgren <affarer@hotmail.com> writes:

> I have some problems getting these things to work:
>
> 1 I want the duration of a couple of soundfiles in a directory
>
> sox --i -D kick_*.wav
>
> the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
> but it doesn’t work with the wildcard.

The Windows command shell doesn't expand wildcards, leaving it up to
each application to do that.  SoX wasn't written with this in mind and
simply takes the arguments as given.  I'm in no mood to change that.

I suggest using some other scripting language, or maybe there's a way to
enable wildcard expansion.

-- 
Måns Rullgård


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-27  9:48         ` Nils Wallgren
@ 2020-05-27 12:31           ` tsepp2000
       [not found]             ` <HE1PR0102MB3225333E72970AB67FB1D914AAB10@HE1PR0102MB3225.eurprd01.prod.exchangelabs.com>
  0 siblings, 1 reply; 14+ messages in thread
From: tsepp2000 @ 2020-05-27 12:31 UTC (permalink / raw)
  To: Nils Wallgren; +Cc: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 507 bytes --]

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”


[-- Attachment #1.2: Type: text/html, Size: 1119 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-27  8:09   ` Nils Wallgren
       [not found]     ` <173dc6c3-ff96-e8b7-a072-3d3f84220e5d@bayern-mail.de>
@ 2020-05-27 12:50     ` Jeff Learman
  2020-05-27 12:55       ` Jeff Learman
  1 sibling, 1 reply; 14+ messages in thread
From: Jeff Learman @ 2020-05-27 12:50 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 3623 bytes --]

"It doesn't work" is not helpful.  Is there an error message?  What DOES
happen?

Forget that for now, though.  Let's stick with Windows CLI.  Evidently the
link I sent wasn't a good one.  Try this

mkdir foo
for %i in (*.wav) do sox %i -b 8 foo\%i

You can use "help for" in Windows cmd window for more info on how to use
"for".

On Wed, 27 May 2020 at 04:10, Nils Wallgren <affarer@hotmail.com> wrote:

> Thanks for the reply. I am using windows 10 command prompt. Maybe not
> optimal but It’s kind of hard to know
>
> which one to use if your not an experienced programmer. I have Git Bash,
> is this is what you mean? But I don’t use it
>
> because I can’t get the set audiodriver to work as I could in the command
> prompt. In cmd.exe this is the first thing I do
>
> set audiodriver=waveaudio and I am ready to go. I guess there is a simple
> way to set up this from bash but
>
> I havn’t found any answer. The amount of questions quickly escalates
>
>
>
> When I ran your first script inside bash it didn’t work
>
> Just to make things clear:
>
> I ran this inside of Git Bash from a chosen folder set as my cd
>
> I also have to create a new folder within in this cd with mkdir?
>
>
>
> Then I’ll use for F in *.wav ; do
>
>     sox $F -b 8 nameoffolder/$F
>
> done
>
>
>
> But It doesn’t work
>
>
>
> But It would be nice to run it inside Command Prompt in windows 10.
>
> I have been using sox in with cmd.exe because it worked for but most
> information I find using sox is on Linux
>
> So maybe I should switch..
>
>
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> *From: *Jeff Learman <jjlearman@gmail.com>
> *Sent: *Wednesday, 27 May 2020 02:23
> *To: *sox-users@lists.sourceforge.net
> *Subject: *Re: [SoX-users] BatchProcessing Files on Windows
>
>
>
> For the first question, I'll let the devs answer, but apparently sox
> doesn't batch.
>
>
>
> For the second question, that's not a sox issue; it's a scripting
> question.  What shell are you using?  For bash:
>
>
>
> for F in *.wav ; do
>
>     sox $F -b 8 mydir/$F
>
> done
>
>
>
> I'm guessing you use Windows CLI?  For that I'd use this:
> https://ss64.com/nt/for2.html -- so it looks like you just need %%
> instead of %, and a backslash between the dir name and the wave file name.
>
>
>
> Jeff
>
>
>
>
>
>
>
>
>
> On Tue, 26 May 2020 at 18:31, Nils Wallgren <affarer@hotmail.com> wrote:
>
> I have some problems getting these things to work:
>
>
>
> 1 I want the duration of a couple of soundfiles in a directory
>
>
>
> sox --i -D kick_*.wav
>
>
>
> the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
>
> but it doesn’t work with the wildcard.
>
>
>
> 2 If I want to batch process a couple of files in a directory and
> process/convert them to something else
>
> And put the processed files in a new folder, how do I do that?
>
>
>
> for %i in *.wav do sox "%i" -b 8  "n_%i" .flac
>
>
>
> (also not sure of the conversion of the files when batching)
>
>
>
> Best,
>
>
>
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
>
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>
>
> _______________________________________________
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users
>

[-- Attachment #1.2: Type: text/html, Size: 8817 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-27 12:50     ` Jeff Learman
@ 2020-05-27 12:55       ` Jeff Learman
  0 siblings, 0 replies; 14+ messages in thread
From: Jeff Learman @ 2020-05-27 12:55 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 4027 bytes --]

Oops didn't see other replies.  Please ignore my response.  I now see that
the only remaining issue is what we would use "basename -s" for in linux.

On Wed, 27 May 2020 at 08:50, Jeff Learman <jjlearman@gmail.com> wrote:

> "It doesn't work" is not helpful.  Is there an error message?  What DOES
> happen?
>
> Forget that for now, though.  Let's stick with Windows CLI.  Evidently the
> link I sent wasn't a good one.  Try this
>
> mkdir foo
> for %i in (*.wav) do sox %i -b 8 foo\%i
>
> You can use "help for" in Windows cmd window for more info on how to use
> "for".
>
> On Wed, 27 May 2020 at 04:10, Nils Wallgren <affarer@hotmail.com> wrote:
>
>> Thanks for the reply. I am using windows 10 command prompt. Maybe not
>> optimal but It’s kind of hard to know
>>
>> which one to use if your not an experienced programmer. I have Git Bash,
>> is this is what you mean? But I don’t use it
>>
>> because I can’t get the set audiodriver to work as I could in the command
>> prompt. In cmd.exe this is the first thing I do
>>
>> set audiodriver=waveaudio and I am ready to go. I guess there is a simple
>> way to set up this from bash but
>>
>> I havn’t found any answer. The amount of questions quickly escalates
>>
>>
>>
>> When I ran your first script inside bash it didn’t work
>>
>> Just to make things clear:
>>
>> I ran this inside of Git Bash from a chosen folder set as my cd
>>
>> I also have to create a new folder within in this cd with mkdir?
>>
>>
>>
>> Then I’ll use for F in *.wav ; do
>>
>>     sox $F -b 8 nameoffolder/$F
>>
>> done
>>
>>
>>
>> But It doesn’t work
>>
>>
>>
>> But It would be nice to run it inside Command Prompt in windows 10.
>>
>> I have been using sox in with cmd.exe because it worked for but most
>> information I find using sox is on Linux
>>
>> So maybe I should switch..
>>
>>
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
>> Windows 10
>>
>>
>>
>> *From: *Jeff Learman <jjlearman@gmail.com>
>> *Sent: *Wednesday, 27 May 2020 02:23
>> *To: *sox-users@lists.sourceforge.net
>> *Subject: *Re: [SoX-users] BatchProcessing Files on Windows
>>
>>
>>
>> For the first question, I'll let the devs answer, but apparently sox
>> doesn't batch.
>>
>>
>>
>> For the second question, that's not a sox issue; it's a scripting
>> question.  What shell are you using?  For bash:
>>
>>
>>
>> for F in *.wav ; do
>>
>>     sox $F -b 8 mydir/$F
>>
>> done
>>
>>
>>
>> I'm guessing you use Windows CLI?  For that I'd use this:
>> https://ss64.com/nt/for2.html -- so it looks like you just need %%
>> instead of %, and a backslash between the dir name and the wave file name.
>>
>>
>>
>> Jeff
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, 26 May 2020 at 18:31, Nils Wallgren <affarer@hotmail.com> wrote:
>>
>> I have some problems getting these things to work:
>>
>>
>>
>> 1 I want the duration of a couple of soundfiles in a directory
>>
>>
>>
>> sox --i -D kick_*.wav
>>
>>
>>
>> the name of the sound files are kick_1.wav, kick_2.wav, kick_3.wav etc
>>
>> but it doesn’t work with the wildcard.
>>
>>
>>
>> 2 If I want to batch process a couple of files in a directory and
>> process/convert them to something else
>>
>> And put the processed files in a new folder, how do I do that?
>>
>>
>>
>> for %i in *.wav do sox "%i" -b 8  "n_%i" .flac
>>
>>
>>
>> (also not sure of the conversion of the files when batching)
>>
>>
>>
>> Best,
>>
>>
>>
>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
>> Windows 10
>>
>>
>>
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>>
>> _______________________________________________
>> Sox-users mailing list
>> Sox-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/sox-users
>>
>

[-- Attachment #1.2: Type: text/html, Size: 9307 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
       [not found]             ` <HE1PR0102MB3225333E72970AB67FB1D914AAB10@HE1PR0102MB3225.eurprd01.prod.exchangelabs.com>
@ 2020-05-28  5:35               ` tsepp2000
  2020-05-28 14:07                 ` Jeff Learman
  2020-05-28  5:53               ` tsepp2000
  1 sibling, 1 reply; 14+ messages in thread
From: tsepp2000 @ 2020-05-28  5:35 UTC (permalink / raw)
  To: Nils Wallgren; +Cc: sox-users

[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]

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”
>

[-- Attachment #2: command.txt --]
[-- Type: text/plain, Size: 105 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



[-- Attachment #4: Type: text/plain, Size: 158 bytes --]

_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
       [not found]             ` <HE1PR0102MB3225333E72970AB67FB1D914AAB10@HE1PR0102MB3225.eurprd01.prod.exchangelabs.com>
  2020-05-28  5:35               ` tsepp2000
@ 2020-05-28  5:53               ` tsepp2000
  1 sibling, 0 replies; 14+ messages in thread
From: tsepp2000 @ 2020-05-28  5:53 UTC (permalink / raw)
  To: Nils Wallgren; +Cc: sox-users

Help: for /?

"N" only creates the file name of %I.

Am 27.05.2020 um 15:33 schrieb Nils Wallgren:
> But not really sure what the ~NF is short for.


_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-28  5:35               ` tsepp2000
@ 2020-05-28 14:07                 ` Jeff Learman
  2020-05-28 14:17                   ` Jeff Learman
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Learman @ 2020-05-28 14:07 UTC (permalink / raw)
  To: sox-users


[-- 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-28 14:07                 ` Jeff Learman
@ 2020-05-28 14:17                   ` Jeff Learman
  2020-05-29 12:24                     ` Nils Wallgren
  0 siblings, 1 reply; 14+ messages in thread
From: Jeff Learman @ 2020-05-28 14:17 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 3803 bytes --]

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 <jjlearman@gmail.com> 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, 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: 5981 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: BatchProcessing Files on Windows
  2020-05-28 14:17                   ` Jeff Learman
@ 2020-05-29 12:24                     ` Nils Wallgren
  0 siblings, 0 replies; 14+ messages in thread
From: Nils Wallgren @ 2020-05-29 12:24 UTC (permalink / raw)
  To: sox-users


[-- Attachment #1.1: Type: text/plain, Size: 4269 bytes --]

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:jjlearman@gmail.com>
Sent: Thursday, 28 May 2020 16:19
To: sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
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 <jjlearman@gmail.com<mailto:jjlearman@gmail.com>> 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, tsepp2000@web.de<mailto:tsepp2000@web.de> <tsepp2000@web.de<mailto: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> <mailto:tsepp2000@web.de<mailto:tsepp2000@web.de>>
> *Sent: *Wednesday, 27 May 2020 14:31
> *To: *Nils Wallgren <mailto:affarer@hotmail.com<mailto:affarer@hotmail.com>>
> *Cc: *sox-users@lists.sourceforge.net<mailto:sox-users@lists.sourceforge.net>
> <mailto: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<mailto:Sox-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/sox-users


[-- Attachment #1.2: Type: text/html, Size: 8141 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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-05-29 12:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

sox-users@lists.sourceforge.net unofficial mirror

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/sox-users

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 sox-users sox-users/ https://public-inbox.org/sox-users \
		sox-users@lists.sourceforge.net
	public-inbox-index sox-users

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/sox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git