diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..5ef6789f8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "terminal.integrated.commandsToSkipShell": [ + "" + ] +} \ No newline at end of file diff --git a/encoder/audio.py b/encoder/audio.py index 799aa8354..a95ee3d21 100644 --- a/encoder/audio.py +++ b/encoder/audio.py @@ -1,5 +1,5 @@ -from scipy.ndimage.morphology import binary_dilation -from encoder.params_data import * +from scipy.ndimage import binary_dilation +from .params_data import sampling_rate, audio_norm_target_dBFS, vad_window_length, vad_moving_average_width, vad_max_silence_length, mel_window_length, mel_window_step, mel_n_channels from pathlib import Path from typing import Optional, Union from warnings import warn @@ -95,7 +95,7 @@ def trim_long_silences(wav): def moving_average(array, width): array_padded = np.concatenate((np.zeros((width - 1) // 2), array, np.zeros(width // 2))) ret = np.cumsum(array_padded, dtype=float) - ret[width:] = ret[width:] - ret[:-width] + ret[width:] = ret[width:] - ret[:len(ret) - width] return ret[width - 1:] / width audio_mask = moving_average(voice_flags, vad_moving_average_width) diff --git a/samples/1320_00000.coveragexml b/samples/1320_00000.coveragexml new file mode 100644 index 000000000..e69de29bb