diff --git a/create_mixed_audio_file.py b/create_mixed_audio_file.py index 806cdfa..81706c0 100644 --- a/create_mixed_audio_file.py +++ b/create_mixed_audio_file.py @@ -29,6 +29,7 @@ def cal_amp(wf): return amptitude def cal_rms(amp): + amp = np.trim_zeros(amp) # to remove leading and trailing zeros (representing silence in the audio beginning/end) return np.sqrt(np.mean(np.square(amp), axis=-1)) def save_waveform(output_path, params, amp):