Remove start of new track from end of audio file
Asked Answered
M

1

8

I've a couple of recordings where at the end of the track there's silence and the start of a new track (fraction). I tried to remove the start of the new track from the end of the file.

My command (*nux)

sox file_in.mp3 -C 320 file_out.mp3 silence 1 0.75 0.2% -1 0.75 0.2%

Preferably keep the silence at the end or just add some new. Any help appreciated

Mlle answered 27/10, 2018 at 7:4 Comment(1)
Could you please provide a link to an example file?Pilgrimage
S
5

Probably you can use the below period parameter without the above period.

A bit of silence can optionally be kept with the -l parameter (or you can just use pad with a fixed amount).

For example:

sox input.mp3 -C 320 output.mp3 silence -l 0 1 0.5 0.5%

Sample input:

Sample input

Result:

enter image description here


Note, if the beginning of some new tracks has long silence periods inside, it may be tricky - but usually possible - to find appropriate duration and threshold parameters (the general case, apparently, it is not tractable at all by simple processing, one needs a machine learning approach to reliably mark inner periods of silence that belong to a track).

Also, if it is just a couple of files, opening an editor e.g. Audacity is the quickest and the best outcome approach.

Shaven answered 12/11, 2018 at 19:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.