Skip to content

Commit

Permalink
Pass speaker_wav argument to tts_to_file in tts_with_vc method
Browse files Browse the repository at this point in the history
When `tts_with_vc_to_file` is invoked with only `speaker_wav` and not `speaker`, it was throwing the error.

Error in text to speech: Model is multi-speaker but no `speaker` is provided.

```
 File ".../.conda/envs/venv/lib/python3.11/site-packages/TTS/api.py", line 416, in tts_with_vc
    self.tts_to_file(
  File ".../.conda/envs/venv/lib/python3.11/site-packages/TTS/api.py", line 333, in tts_to_file
    self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
  File ".../.conda/envs/venv/lib/python3.11/site-packages/TTS/api.py", line 228, in _check_arguments
    raise ValueError("Model is multi-speaker but no `speaker` is provided.")
ValueError: Model is multi-speaker but no `speaker` is provided.
ERROR:app.std.app_logger:Error in text to speech: Model is multi-speaker but no `speaker` is provided.
  • Loading branch information
hanasim committed May 29, 2024
1 parent 0d1aa58 commit 635e914
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TTS/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def tts_with_vc(
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
# Lazy code... save it to a temp file to resample it while reading it for VC
self.tts_to_file(
text=text, speaker=speaker, language=language, file_path=fp.name, split_sentences=split_sentences
text=text, speaker=speaker, speaker_wav=speaker_wav, language=language, file_path=fp.name, split_sentences=split_sentences
)
if self.voice_converter is None:
self.load_vc_model_by_name("voice_conversion_models/multilingual/vctk/freevc24")
Expand Down

0 comments on commit 635e914

Please sign in to comment.