A button to trim silences (ffmpeg)

Hello,
I would like to create a button to remove silences at the beginning and end of an mp3. I managed to delete n seconds from the beginning and / or n seconds from the end, I also managed to remove all the silences of a song, but never the silence of the beginning and the end only.
Sorry for this slight off-topic of DO but I hope you can help me (with probably ffmpeg).

Thanks in advance for your help...

Yes, Ffmpeg should be able to do this. You'll find the audio filter here:

https://ffmpeg.org/ffmpeg-filters.html#silenceremove

Try this in Opus:

ffmpeg.exe -i {filepath$} -af silenceremove=1:1:-50dB:1:1:-50dB:1:rms:0.02 {filepath$|noext}.{time|HHmmss}.mp3

I hope your problems were on the Opus side, because in my testing I couldn't figure out the right values for the parameters.

Thanks for your help Ixp :slight_smile:
In my testing, it didn't work as expected : It seems that it just keep the silence at the begining, and the part until it reaches the next silence...