Reputation: 454
I have a 10 minute audio which I want to break in chunks of time as follows: (the format is mm:ss.frac)
1. 1.wav -> 00.000 - 20.271
2. 2.wav -> 20.272 - 47.550
3. 3.wav -> 47.551 - 01:20.562
I tried using the trim
command like such
sox infile outfile trim 0.000 20.271
However the format istrim start [length]
Worst case, I will have to calculate the durations for individual chunks. Is there another way?
Upvotes: 2
Views: 3092
Reputation: 454
I found that the simplest solution is to write the command as such:
sox infile outfile start =end
The audio is not sent to the output stream until the start location is reached and specifying an end location can be done by using the "=" sign with the end time.
So the code would now be, for instance:
sox forth.wav 10.wav trim 303.463 =353.790
trim start [length|=end] The optional length parameter gives the length of audio to output after the start sample and is thus used to trim off the end of the audio. Alternatively, an absolute end location can be given by preceding it with an equals sign. Using a value of 0 for the start parameter will allow trimming off the end only.
Upvotes: 4