From 3b9fca2398837e03a63e1347c1bbd2fcb39c0811 Mon Sep 17 00:00:00 2001 From: Eren G??lge Date: Wed, 21 Jun 2023 12:02:06 +0200 Subject: [PATCH] Make style --- TTS/tts/configs/bark_config.py | 2 +- TTS/tts/layers/bark/inference_funcs.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TTS/tts/configs/bark_config.py b/TTS/tts/configs/bark_config.py index 943f3dea..647116bd 100644 --- a/TTS/tts/configs/bark_config.py +++ b/TTS/tts/configs/bark_config.py @@ -11,7 +11,7 @@ from TTS.utils.generic_utils import get_user_data_dir @dataclass class BarkConfig(BaseTTSConfig): - """ Bark TTS configuration + """Bark TTS configuration Args: model (str): model name that registers the model. diff --git a/TTS/tts/layers/bark/inference_funcs.py b/TTS/tts/layers/bark/inference_funcs.py index 2b27246d..dcb13ea0 100644 --- a/TTS/tts/layers/bark/inference_funcs.py +++ b/TTS/tts/layers/bark/inference_funcs.py @@ -49,11 +49,11 @@ def get_voices(extra_voice_dirs: List[str] = []): def load_npz(npz_file): - x_history = np.load(npz_file) - semantic = x_history["semantic_prompt"] - coarse = x_history["coarse_prompt"] - fine = x_history["fine_prompt"] - return semantic, coarse, fine + x_history = np.load(npz_file) + semantic = x_history["semantic_prompt"] + coarse = x_history["coarse_prompt"] + fine = x_history["fine_prompt"] + return semantic, coarse, fine def load_voice(model, voice: str, extra_voice_dirs: List[str] = []): # pylint: disable=dangerous-default-value @@ -79,9 +79,9 @@ def load_voice(model, voice: str, extra_voice_dirs: List[str] = []): # pylint: # replace the file extension with .npz output_path = os.path.splitext(audio_path)[0] + ".npz" generate_voice(audio=audio_path, model=model, output_path=output_path) - breakpoint() return load_voice(model, voice, extra_voice_dirs) + def zero_crossing_rate(audio, frame_length=1024, hop_length=512): zero_crossings = np.sum(np.abs(np.diff(np.sign(audio))) / 2) total_frames = 1 + int((len(audio) - frame_length) / hop_length)