sox-users@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Chopping wav samples
@ 2020-03-20  9:37 K. H. Hom via Sox-users
  2020-03-20 20:41 ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 5+ messages in thread
From: K. H. Hom via Sox-users @ 2020-03-20  9:37 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net; +Cc: K. H. Hom


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

Hi,
when i navigate to the folder with the source file and manually execute the following command it works:
sox threebursts.wav temp_outfile.wav silence 1 0.1 1 : newfile : restart

but if I craete a batch file which takes teh file as argument, it doent work:
sox "%~1" temp_outfile.wav silence 1 0.1 1% 1 0.1 1% : newfile : restart

it results into :
>sox "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav" temp_outfile.wav silence 1 0.1 1 : newfile : restart

Any idea why that do not work please?

Cheers H

[-- Attachment #1.2: Type: text/html, Size: 715 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] 5+ messages in thread

* Re: Chopping wav samples
  2020-03-20  9:37 Chopping wav samples K. H. Hom via Sox-users
@ 2020-03-20 20:41 ` Jeremy Nicoll - ml sox users
  2020-03-24  9:48   ` K. H. Hom via Sox-users
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2020-03-20 20:41 UTC (permalink / raw)
  To: sox-users

On 2020-03-20 09:37, K. H. Hom via Sox-users wrote:
> Hi,
> when i navigate to the folder with the source file and manually
> execute the following command it works:
> sox threebursts.wav temp_outfile.wav silence 1 0.1 1 : newfile : 
> restart
> 
> but if I craete a batch file which takes teh file as argument, it doent 
> work:
> sox "%~1" temp_outfile.wav silence 1 0.1 1% 1 0.1 1% : newfile : 
> restart
> 
> it results into :
>> sox "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav" 
>> temp_outfile.wav silence 1 0.1 1 : newfile : restart
> 
> Any idea why that do not work please?


A % sign has special meaning in bat files.  Look - you used "%~1" - and 
expected that
to be replaced by a parameter.  Well, further along the command the 
other % chars
caused a problem.

You need to use %% where you want a single one.  See: "Quoting and 
escaping" at:

https://en.wikibooks.org/wiki/Windows_Batch_Scripting#How_a_command_line_is_interpreted



-- 
Jeremy Nicoll - my opinions are my own


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

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

* Re: Chopping wav samples
  2020-03-20 20:41 ` Jeremy Nicoll - ml sox users
@ 2020-03-24  9:48   ` K. H. Hom via Sox-users
  2020-03-24 14:01     ` Jeremy Nicoll - ml sox users
  0 siblings, 1 reply; 5+ messages in thread
From: K. H. Hom via Sox-users @ 2020-03-24  9:48 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net; +Cc: K. H. Hom

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



Thank you for the reply.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Am Freitag, März 20, 2020 9:41 PM schrieb Jeremy Nicoll - ml sox users <jn.ml.sxu.88@wingsandbeaks.org.uk>:

> On 2020-03-20 09:37, K. H. Hom via Sox-users wrote:
>
> > Hi,
> > when i navigate to the folder with the source file and manually
> > execute the following command it works:
> > sox threebursts.wav temp_outfile.wav silence 1 0.1 1 : newfile :
> > restart
> > but if I craete a batch file which takes teh file as argument, it doent
> > work:
> > sox "%~1" temp_outfile.wav silence 1 0.1 1% 1 0.1 1% : newfile :
> > restart
> > it results into :
> >
> > > sox "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav"
> > > temp_outfile.wav silence 1 0.1 1 : newfile : restart
> >
> > Any idea why that do not work please?
>
> A % sign has special meaning in bat files. Look - you used "%~1" - and
> expected that
> to be replaced by a parameter. Well, further along the command the
> other % chars
> caused a problem.
>
> You need to use %% where you want a single one. See: "Quoting and
> escaping" at:
>
> https://en.wikibooks.org/wiki/Windows_Batch_Scripting#How_a_command_line_is_interpreted

Yeah I know and the manual says :
"
The command-line arguments AKA command-line parameters passed to a batch script are accessible as %1, %2, ..., %9.
"
as well as "%~1" search the doc ...

When dragging a file on the the bat file , the %~1 with be replaced with the path to the file as mentioned in my first post. But that wasnt the question. It works , try it.

So "%~1" becomes  "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav"

The question is now wht is this command not working:

sox "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav" temp_outfile.wav silence 1 0.1 1 : newfile : restart


Cheers H

>
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Jeremy Nicoll - my opinions are my own
>
> Sox-users mailing list
> Sox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-users



[-- Attachment #2: firefox_KvOQ4GMyhG.png --]
[-- Type: image/png, Size: 15277 bytes --]

[-- 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] 5+ messages in thread

* Re: Chopping wav samples
  2020-03-24  9:48   ` K. H. Hom via Sox-users
@ 2020-03-24 14:01     ` Jeremy Nicoll - ml sox users
  2020-03-29 14:27       ` K. H. Hom via Sox-users
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Nicoll - ml sox users @ 2020-03-24 14:01 UTC (permalink / raw)
  To: sox-users

On 2020-03-24 09:48, K. H. Hom via Sox-users wrote:
> Thank you for the reply.



> Am Freitag, März 20, 2020 9:41 PM schrieb Jeremy Nicoll - ml sox users
> <jn.ml.sxu.88@wingsandbeaks.org.uk>:

>> You need to use %% where you want a single one. See: "Quoting and
>> escaping" at:
>> 
>> https://en.wikibooks.org/wiki/Windows_Batch_Scripting#How_a_command_line_is_interpreted
> 
> Yeah I know and the manual says :
> "
> The command-line arguments AKA command-line parameters passed to a
> batch script are accessible as %1, %2, ..., %9.
> "
> as well as "%~1" search the doc ...
> 
> When dragging a file on the the bat file , the %~1 with be replaced
> with the path to the file as mentioned in my first post. But that
> wasnt the question.

No, but the "&" signs further along your command might be the problem.  
In your
original question you described a command containing

  sox "%~1" temp_outfile.wav silence 1 0.1 1% 1 0.1 1% : newfile : 
restart

Note the: "1 0.1 1% 1 0.1 1% "

I am not sure whether your command really contained all of that or had 
the
simpler "1 0.1 1" parameters in it.

I was trying to say that if you'd wanted  "1 0.1 1% 1 0.1 1%"  to work 
you
would have needed to code  "1 0.1 1%% 1 0.1 1%%", for the BAT file to 
use
the command you wanted.

If that's not what you were asking, you need to be clearer.




> The question is now wht is this command not working:
> 
> sox "C:\Users\hom\Downloads\Desktop\New folder (3)\threebursts.wav"
> temp_outfile.wav silence 1 0.1 1 : newfile : restart

OK, so that's a different question.   "Not working" is not a useful
description of what is or is not happening.

What is in threebursts.wav?

What does happen?  How many files are produced, if any?

What did you expect/hope would happen?

Does the expected single action work properly if you omit the newfile
& restart?


-- 
Jeremy Nicoll - my opinions are my own


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

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

* Re: Chopping wav samples
  2020-03-24 14:01     ` Jeremy Nicoll - ml sox users
@ 2020-03-29 14:27       ` K. H. Hom via Sox-users
  0 siblings, 0 replies; 5+ messages in thread
From: K. H. Hom via Sox-users @ 2020-03-29 14:27 UTC (permalink / raw)
  To: sox-users@lists.sourceforge.net; +Cc: K. H. Hom


> OK, so that's a different question. "Not working" is not a useful
> description of what is or is not happening.
>
> What is in threebursts.wav?
>
> What does happen? How many files are produced, if any?
>
> What did you expect/hope would happen?
>
> Does the expected single action work properly if you omit the newfile
> & restart?
>

Hi,
thank you very much for the replay, Here this is the article I am following:
https://www.madskjeldgaard.dk/sox-tutorial-split-by-silence/

It seams to work now.
Thank you !
Cheers H

>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Jeremy Nicoll - my opinions are my own
>
> 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

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

end of thread, other threads:[~2020-03-29 14:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-20  9:37 Chopping wav samples K. H. Hom via Sox-users
2020-03-20 20:41 ` Jeremy Nicoll - ml sox users
2020-03-24  9:48   ` K. H. Hom via Sox-users
2020-03-24 14:01     ` Jeremy Nicoll - ml sox users
2020-03-29 14:27       ` K. H. Hom via Sox-users

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).