mirror of https://github.com/coqui-ai/TTS.git
Make style
This commit is contained in:
parent
0f8932a6a9
commit
3b9fca2398
|
@ -11,7 +11,7 @@ from TTS.utils.generic_utils import get_user_data_dir
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class BarkConfig(BaseTTSConfig):
|
class BarkConfig(BaseTTSConfig):
|
||||||
""" Bark TTS configuration
|
"""Bark TTS configuration
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
model (str): model name that registers the model.
|
model (str): model name that registers the model.
|
||||||
|
|
|
@ -49,11 +49,11 @@ def get_voices(extra_voice_dirs: List[str] = []):
|
||||||
|
|
||||||
|
|
||||||
def load_npz(npz_file):
|
def load_npz(npz_file):
|
||||||
x_history = np.load(npz_file)
|
x_history = np.load(npz_file)
|
||||||
semantic = x_history["semantic_prompt"]
|
semantic = x_history["semantic_prompt"]
|
||||||
coarse = x_history["coarse_prompt"]
|
coarse = x_history["coarse_prompt"]
|
||||||
fine = x_history["fine_prompt"]
|
fine = x_history["fine_prompt"]
|
||||||
return semantic, coarse, fine
|
return semantic, coarse, fine
|
||||||
|
|
||||||
|
|
||||||
def load_voice(model, voice: str, extra_voice_dirs: List[str] = []): # pylint: disable=dangerous-default-value
|
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
|
# replace the file extension with .npz
|
||||||
output_path = os.path.splitext(audio_path)[0] + ".npz"
|
output_path = os.path.splitext(audio_path)[0] + ".npz"
|
||||||
generate_voice(audio=audio_path, model=model, output_path=output_path)
|
generate_voice(audio=audio_path, model=model, output_path=output_path)
|
||||||
breakpoint()
|
|
||||||
return load_voice(model, voice, extra_voice_dirs)
|
return load_voice(model, voice, extra_voice_dirs)
|
||||||
|
|
||||||
|
|
||||||
def zero_crossing_rate(audio, frame_length=1024, hop_length=512):
|
def zero_crossing_rate(audio, frame_length=1024, hop_length=512):
|
||||||
zero_crossings = np.sum(np.abs(np.diff(np.sign(audio))) / 2)
|
zero_crossings = np.sum(np.abs(np.diff(np.sign(audio))) / 2)
|
||||||
total_frames = 1 + int((len(audio) - frame_length) / hop_length)
|
total_frames = 1 + int((len(audio) - frame_length) / hop_length)
|
||||||
|
|
Loading…
Reference in New Issue