IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
SoX batch that trims beginning and end of file?
th0m
post Jun 16 2012, 20:45
Post #1





Group: Members
Posts: 22
Joined: 19-July 08
Member No.: 56012



Could someone help me with this? I would like a simple drag-and-drop batch file that trims a few samples at the beginning and end of a wav-file.

Any suggestion what the command line should be? Can't seem to sort it out myself.
Go to the top of the page
+Quote Post
chi
post Jun 17 2012, 10:24
Post #2





Group: Members
Posts: 45
Joined: 27-November 11
Member No.: 95439



QUOTE (th0m @ Jun 16 2012, 21:45) *
Any suggestion what the command line should be? Can't seem to sort it out myself.


With SoX 14.4.0,
CODE
sox in.wav out.wav trim 10s -20s
does it (where 10 and 20 are the number of samples to be removed from the beginning and end, respectively).
Go to the top of the page
+Quote Post
bandpass
post Jun 17 2012, 10:30
Post #3





Group: Members
Posts: 326
Joined: 3-August 08
From: UK
Member No.: 56644



There's an example drag and drop batch file in the standard SoX windows distribution, so you copy and modify it per chi's suggestion.
Go to the top of the page
+Quote Post
th0m
post Jun 17 2012, 20:13
Post #4





Group: Members
Posts: 22
Joined: 19-July 08
Member No.: 56012



Perfect, thanks.

Ended up with this:
cd %~dp0
mkdir trimmed
FOR %%A IN (%*) DO sox %%A "trimmed/%%~nxA" trim Xs -Xs
pause


Works like a charm.

This post has been edited by th0m: Jun 17 2012, 20:14
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 1st August 2014 - 08:18