1
0

forgot the important reason I even started working on AIVC again

This commit is contained in:
mrq 2023-08-21 03:42:12 +00:00
parent 72a38ff2fc
commit eeddd4cb6b
2 changed files with 14 additions and 5 deletions

@ -1 +1 @@
Subproject commit cbd3c95c42ac1da9772f61b9895954ee693075c9
Subproject commit b10c58436d6871c26485d30b203e6cfdd4167602

View File

@ -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
files = os.listdir(subj)
voice = list(glob(f'{subj}/*.wav')) + list(glob(f'{subj}/*.mp3')) + list(glob(f'{subj}/*.flac'))
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"]):