From eeddd4cb6b18d0f7028a83643e249e6449a890e8 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 21 Aug 2023 03:42:12 +0000 Subject: [PATCH] forgot the important reason I even started working on AIVC again --- modules/tortoise-tts | 2 +- src/utils.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/modules/tortoise-tts b/modules/tortoise-tts index cbd3c95..b10c584 160000 --- a/modules/tortoise-tts +++ b/modules/tortoise-tts @@ -1 +1 @@ -Subproject commit cbd3c95c42ac1da9772f61b9895954ee693075c9 +Subproject commit b10c58436d6871c26485d30b203e6cfdd4167602 diff --git a/src/utils.py b/src/utils.py index a79c6ce..cf93489 100755 --- a/src/utils.py +++ b/src/utils.py @@ -3052,14 +3052,23 @@ def import_voices(files, saveAs=None, progress=None): def relative_paths( dirs ): return [ './' + os.path.relpath( d ).replace("\\", "/") for d in dirs ] -def get_voice( name, dir=get_voice_dir(), load_latents=True ): +def get_voice( name, dir=get_voice_dir(), load_latents=True, extensions=["wav", "mp3", "flac"] ): subj = f'{dir}/{name}/' if not os.path.isdir(subj): return - - voice = list(glob(f'{subj}/*.wav')) + list(glob(f'{subj}/*.mp3')) + list(glob(f'{subj}/*.flac')) + files = os.listdir(subj) + if load_latents: - voice = voice + list(glob(f'{subj}/*.pth')) + extensions.append("pth") + + voice = [] + for file in files: + ext = os.path.splitext(file)[-1][1:] + if ext not in extensions: + continue + + voice.append(f'{subj}/{file}') + return sorted( voice ) def get_voice_list(dir=get_voice_dir(), append_defaults=False, extensions=["wav", "mp3", "flac", "pth"]):