mirror of https://github.com/coqui-ai/TTS.git
fix(api): clearer error message when model doesn't support VC
This commit is contained in:
parent
d488441b75
commit
6927e0bb89
|
@ -357,15 +357,17 @@ class TTS(nn.Module):
|
||||||
target_wav (str):`
|
target_wav (str):`
|
||||||
Path to the target wav file.
|
Path to the target wav file.
|
||||||
"""
|
"""
|
||||||
wav = self.voice_converter.voice_conversion(source_wav=source_wav, target_wav=target_wav)
|
if self.voice_converter is None:
|
||||||
return wav
|
msg = "The selected model does not support voice conversion."
|
||||||
|
raise RuntimeError(msg)
|
||||||
|
return self.voice_converter.voice_conversion(source_wav=source_wav, target_wav=target_wav)
|
||||||
|
|
||||||
def voice_conversion_to_file(
|
def voice_conversion_to_file(
|
||||||
self,
|
self,
|
||||||
source_wav: str,
|
source_wav: str,
|
||||||
target_wav: str,
|
target_wav: str,
|
||||||
file_path: str = "output.wav",
|
file_path: str = "output.wav",
|
||||||
):
|
) -> str:
|
||||||
"""Voice conversion with FreeVC. Convert source wav to target speaker.
|
"""Voice conversion with FreeVC. Convert source wav to target speaker.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
Loading…
Reference in New Issue