[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-users
Subject:    Re: [SoX-users] Replace sound with silence
From:       Kevin Donnelly <kevin () dotmon ! com>
Date:       2012-01-28 11:59:58
Message-ID: 201201281159.58374.kevin () dotmon ! com
[Download RAW message or body]

Hi Ulrich

Cool, I compiled and installed rc2 of SoX 14.4.0, and the invocation:
sox input.wav output.wav pad duration@startpoint trim 0 endpoint duration 
splice startpoint endpoint  
seems to work fine, as in:
sox silence_test.wav silence_kd.wav pad 2.601@113.878 trim 0 116.479 2.601 
splice 113.878 116.479 
 
It also works with mp3 input and output files.

Multiple silencing also seems to work fine.  I need to make multiple small 
silencings in the course of relatively long files (eg 116 silencings in a 32-
minute file), so I've used a database to build the sox command (the instance 
for this example is given below).

A couple of things to note:
(a) Cases where a segment to be silenced falls within a previous segment to be 
silenced need to be deleted, otherwise pad will error out.
(b) Cases where a segment to be silenced has a startpoint that is less than 
the endpoint of a previous segment to be silenced need to be adjusted, 
otherwise splice will error out.  I'm just updating the startpoint to be 1 
millisecond later than the previous endpoint, and then recalculating the 
duration.
(c) There is a warning at the end like:
WARN splice: Input audio too short; splices not made: 210
but listening to the file suggests that all the edits have been made in the 
correct place.

Some stats:
testfile1, 32m long, 22Mb, 116 edits processed in 1m16s, output file 29Mb
testfile2, 11m long, 8Mb, 122 edits processed in 0m25s, output file 11Mb
As you can see, the output file is about a third bigger than the input file.

So SoX rocks! :-)

Example sox command:
----------------------------------
sox input.mp3 output.mp3 \
pad \
1.823@6.268 \
1.561@10.2 \
3.79@14.698 \
4.217@23.69 \
1.59@30.499 \
0.674@33.229 \
1.394@39.938 \
2.798@41.425 \
1.498@45.96 \
2.606@47.52 \
3.094@55.311 \
0.899@58.565 \
1.672@59.757 \
4.22@63.029 \
1.596@67.731 \
2.02@74.931 \
1.137@81.47 \
3.982@82.608 \
2.711@87.162 \
2.02@90.697 \
4.191@97.699 \
1.346@106.815 \
2.026@108.208 \
4.699@110.298 \
9.764@120.835 \
3.234@130.616 \
1.747@137.248 \
1.816@138.996 \
0.726@144.373 \
1.73@147.902 \
2.621@149.633 \
3.599@156.095 \
2.148@160.642 \
1.556@163.316 \
5.023@167.285 \
0.417@173.714 \
1.539@179.201 \
0.68@183.62 \
2.143@184.308 \
4.451@186.498 \
0.581@195.442 \
1.852@197.507 \
2.322@205.396 \
2.374@221.883 \
0.487@225.704 \
1.329@226.209 \
2.763@228.446 \
2.203@233.952 \
3.132@237.31 \
1.777@240.614 \
1.521@242.425 \
1.521@244.333 \
1.788@258.137 \
3.863@260.35 \
3.456@264.214 \
1.074@268.725 \
3.054@269.879 \
1.835@279.536 \
1.376@281.723 \
1.625@284.216 \
2.911@287.544 \
0.848@294.531 \
5.065@306.247 \
3.182@314.747 \
5.179@318.891 \
2.508@325.35 \
2.96@332.328 \
2.31@352.069 \
3.06@357.087 \
0.621@360.774 \
3.866@363.564 \
1.271@385.902 \
2.409@392.947 \
1.309@395.704 \
2.496@397.036 \
5.811@404.293 \
4.062@410.113 \
1.463@414.396 \
1.712@418.404 \
3.884@420.424 \
0.825@424.711 \
1.283@430.801 \
1.028@432.484 \
1.828@437.958 \
1.109@440.053 \
1.103@445.057 \
2.857@466.723 \
0.766@469.581 \
1.005@486.78 \
0.976@491.079 \
3.992@494.716 \
1.329@503.152 \
2.745@506.391 \
1.626@515.196 \
3.316@517.278 \
2.467@520.906 \
1.381@526.64 \
1.428@535.178 \
2.115@537.816 \
3.535@544.527 \
1.262@550.183 \
1.393@553.111 \
3.155@558.913 \
0.976@563.872 \
2.699@572.294 \
1.219@580.07 \
1@583.552 \
0.68@592.631 \
2.786@600.13 \
3.172@607.002 \
1.26@611.564 \
0.992@617.808 \
1.643@625.293 \
0.876@630.513 \
2.943@635.85 \
1.498@643.82 \
5.589@648.609 \
2.27@669.047 \
1.672@678.1 \
1.625@683.402 \
0.929@685.855 \
1.399@686.802 \
trim 0 8.091 1.823 \
trim 0 11.761 1.561 \
trim 0 18.488 3.79 \
trim 0 27.907 4.217 \
trim 0 32.089 1.59 \
trim 0 33.903 0.674 \
trim 0 41.332 1.394 \
trim 0 44.223 2.798 \
trim 0 47.458 1.498 \
trim 0 50.126 2.606 \
trim 0 58.405 3.094 \
trim 0 59.464 0.899 \
trim 0 61.429 1.672 \
trim 0 67.249 4.22 \
trim 0 69.327 1.596 \
trim 0 76.951 2.02 \
trim 0 82.607 1.137 \
trim 0 86.59 3.982 \
trim 0 89.873 2.711 \
trim 0 92.717 2.02 \
trim 0 101.89 4.191 \
trim 0 108.161 1.346 \
trim 0 110.234 2.026 \
trim 0 114.997 4.699 \
trim 0 130.599 9.764 \
trim 0 133.85 3.234 \
trim 0 138.995 1.747 \
trim 0 140.812 1.816 \
trim 0 145.099 0.726 \
trim 0 149.632 1.73 \
trim 0 152.254 2.621 \
trim 0 159.694 3.599 \
trim 0 162.79 2.148 \
trim 0 164.872 1.556 \
trim 0 172.308 5.023 \
trim 0 174.131 0.417 \
trim 0 180.74 1.539 \
trim 0 184.3 0.68 \
trim 0 186.451 2.143 \
trim 0 190.949 4.451 \
trim 0 196.023 0.581 \
trim 0 199.359 1.852 \
trim 0 207.718 2.322 \
trim 0 224.257 2.374 \
trim 0 226.191 0.487 \
trim 0 227.538 1.329 \
trim 0 231.209 2.763 \
trim 0 236.155 2.203 \
trim 0 240.442 3.132 \
trim 0 242.391 1.777 \
trim 0 243.946 1.521 \
trim 0 245.854 1.521 \
trim 0 259.925 1.788 \
trim 0 264.213 3.863 \
trim 0 267.67 3.456 \
trim 0 269.799 1.074 \
trim 0 272.933 3.054 \
trim 0 281.371 1.835 \
trim 0 283.099 1.376 \
trim 0 285.841 1.625 \
trim 0 290.455 2.911 \
trim 0 295.379 0.848 \
trim 0 311.312 5.065 \
trim 0 317.929 3.182 \
trim 0 324.07 5.179 \
trim 0 327.858 2.508 \
trim 0 335.288 2.96 \
trim 0 354.379 2.31 \
trim 0 360.147 3.06 \
trim 0 361.395 0.621 \
trim 0 367.43 3.866 \
trim 0 387.173 1.271 \
trim 0 395.356 2.409 \
trim 0 397.013 1.309 \
trim 0 399.532 2.496 \
trim 0 410.104 5.811 \
trim 0 414.175 4.062 \
trim 0 415.859 1.463 \
trim 0 420.116 1.712 \
trim 0 424.308 3.884 \
trim 0 425.536 0.825 \
trim 0 432.084 1.283 \
trim 0 433.512 1.028 \
trim 0 439.786 1.828 \
trim 0 441.162 1.109 \
trim 0 446.16 1.103 \
trim 0 469.58 2.857 \
trim 0 470.347 0.766 \
trim 0 487.785 1.005 \
trim 0 492.055 0.976 \
trim 0 498.708 3.992 \
trim 0 504.481 1.329 \
trim 0 509.136 2.745 \
trim 0 516.822 1.626 \
trim 0 520.594 3.316 \
trim 0 523.373 2.467 \
trim 0 528.021 1.381 \
trim 0 536.606 1.428 \
trim 0 539.931 2.115 \
trim 0 548.062 3.535 \
trim 0 551.445 1.262 \
trim 0 554.504 1.393 \
trim 0 562.068 3.155 \
trim 0 564.848 0.976 \
trim 0 574.993 2.699 \
trim 0 581.289 1.219 \
trim 0 584.552 1 \
trim 0 593.311 0.68 \
trim 0 602.916 2.786 \
trim 0 610.174 3.172 \
trim 0 612.824 1.26 \
trim 0 618.8 0.992 \
trim 0 626.936 1.643 \
trim 0 631.389 0.876 \
trim 0 638.793 2.943 \
trim 0 645.318 1.498 \
trim 0 654.198 5.589 \
trim 0 671.317 2.27 \
trim 0 679.772 1.672 \
trim 0 685.027 1.625 \
trim 0 686.784 0.929 \
trim 0 688.201 1.399 \
splice \
6.268 8.091 \
10.2 11.761 \
14.698 18.488 \
23.69 27.907 \
30.499 32.089 \
33.229 33.903 \
39.938 41.332 \
41.425 44.223 \
45.96 47.458 \
47.52 50.126 \
55.311 58.405 \
58.565 59.464 \
59.757 61.429 \
63.029 67.249 \
67.731 69.327 \
74.931 76.951 \
81.47 82.607 \
82.608 86.59 \
87.162 89.873 \
90.697 92.717 \
97.699 101.89 \
106.815 108.161 \
108.208 110.234 \
110.298 114.997 \
120.835 130.599 \
130.616 133.85 \
137.248 138.995 \
138.996 140.812 \
144.373 145.099 \
147.902 149.632 \
149.633 152.254 \
156.095 159.694 \
160.642 162.79 \
163.316 164.872 \
167.285 172.308 \
173.714 174.131 \
179.201 180.74 \
183.62 184.3 \
184.308 186.451 \
186.498 190.949 \
195.442 196.023 \
197.507 199.359 \
205.396 207.718 \
221.883 224.257 \
225.704 226.191 \
226.209 227.538 \
228.446 231.209 \
233.952 236.155 \
237.31 240.442 \
240.614 242.391 \
242.425 243.946 \
244.333 245.854 \
258.137 259.925 \
260.35 264.213 \
264.214 267.67 \
268.725 269.799 \
269.879 272.933 \
279.536 281.371 \
281.723 283.099 \
284.216 285.841 \
287.544 290.455 \
294.531 295.379 \
306.247 311.312 \
314.747 317.929 \
318.891 324.07 \
325.35 327.858 \
332.328 335.288 \
352.069 354.379 \
357.087 360.147 \
360.774 361.395 \
363.564 367.43 \
385.902 387.173 \
392.947 395.356 \
395.704 397.013 \
397.036 399.532 \
404.293 410.104 \
410.113 414.175 \
414.396 415.859 \
418.404 420.116 \
420.424 424.308 \
424.711 425.536 \
430.801 432.084 \
432.484 433.512 \
437.958 439.786 \
440.053 441.162 \
445.057 446.16 \
466.723 469.58 \
469.581 470.347 \
486.78 487.785 \
491.079 492.055 \
494.716 498.708 \
503.152 504.481 \
506.391 509.136 \
515.196 516.822 \
517.278 520.594 \
520.906 523.373 \
526.64 528.021 \
535.178 536.606 \
537.816 539.931 \
544.527 548.062 \
550.183 551.445 \
553.111 554.504 \
558.913 562.068 \
563.872 564.848 \
572.294 574.993 \
580.07 581.289 \
583.552 584.552 \
592.631 593.311 \
600.13 602.916 \
607.002 610.174 \
611.564 612.824 \
617.808 618.8 \
625.293 626.936 \
630.513 631.389 \
635.85 638.793 \
643.82 645.318 \
648.609 654.198 \
669.047 671.317 \
678.1 679.772 \
683.402 685.027 \
685.855 686.784 \
686.802 688.201 \

-- 
Pob hwyl / Best wishes

Kevin Donnelly
kevindonnelly.org.uk

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Sox-users mailing list
Sox-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic