I’m trying to implement truncate silence through the audacity script api in python. I followed the github pipe_test.py and i’m working with that py as base.
I’m trying to delete silence (-35dB) from an audio file with bare minimum “duration” and “truncate to” (0.001).
These are my instructions:
But all i got is the “noise” part and not the part i was trying to obtain. I’m pretty sure parameters are ok, if i try to do such thing with the gui of Audacity i get the desired effect.
I also tried a lot of different things and formats of output (dB-35, 0,001, 0.001, 0001, -35…) but i can’t get an error explaining why it didn’t work.
Yes, that appears to be the case with the Truncate Silence effect, though many of the other commands just fall back on default values when not specified.
The safe option is to make every parameter explicit.
Another tip: Quotes around values are not necessary for numeric values, but are required for string values that include spaces. When generating commands programmatically, it’s a good idea to ensure that all string values are quoted so that you can reuse the same code whether the value contains space or not.
(Depending on implementation, it may be necessary to escape the quote characters).