Skip to content

Commit 631427b

Browse files
committed
added realtime synthesis for speakers with multple speaker_wavs
1 parent cd21364 commit 631427b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

xtts_api_server/RealtimeTTS/engines/coqui_engine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def send_command(self, command, data):
401401
message = {'command': command, 'data': data}
402402
self.parent_synthesize_pipe.send(message)
403403

404-
def set_cloning_reference(self, cloning_reference_wav: str):
404+
def set_cloning_reference(self, cloning_reference_wav: Union[str, List[str]]):
405405
"""
406406
Send an 'update_reference' command and wait for a response.
407407
"""
@@ -594,7 +594,7 @@ def get_voices(self):
594594

595595
return voice_file_names
596596

597-
def set_voice(self, voice: str):
597+
def set_voice(self, voice: Union[str, List[str]]):
598598
"""
599599
Sets the voice to be used for speech synthesis.
600600
"""
@@ -637,4 +637,4 @@ def shutdown(self):
637637

638638
# Wait for the process to terminate
639639
self.synthesize_process.join()
640-
logging.info('Worker process has been terminated')
640+
logging.info('Worker process has been terminated')

xtts_api_server/tts_funcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def get_speaker_wav(self, speaker_name_or_path):
286286
wav_file = f"{full_path}.wav"
287287
if os.path.isdir(full_path):
288288
# multi-sample speaker
289-
speaker_wav = self.get_wav_files(full_path)
289+
speaker_wav = [ os.path.join(full_path,wav) for wav in self.get_wav_files(full_path) ]
290290
if len(speaker_wav) == 0:
291291
raise ValueError(f"no wav files found in {full_path}")
292292
elif os.path.isfile(wav_file):

0 commit comments

Comments
 (0)