Trim
Added in v0.7.0
Trim leading and trailing silence from an audio signal using librosa.effects.trim
. It considers threshold
(in decibels) below reference defined in parameter top_db
as silence.
Input-output example
In this example we remove silence from the start and end, using the default top_db parameter value
Input sound | Transformed sound |
---|---|
Usage example
from audiomentations import Trim
transform = Trim(
top_db=30.0,
p=1.0
)
augmented_sound = transform(my_waveform_ndarray, sample_rate=16000)