Adjustment of threshold for trimming silence at the ends