diff --git a/TTS/api.py b/TTS/api.py index 12e82af5..ed828250 100644 --- a/TTS/api.py +++ b/TTS/api.py @@ -357,15 +357,17 @@ class TTS(nn.Module): target_wav (str):` Path to the target wav file. """ - wav = self.voice_converter.voice_conversion(source_wav=source_wav, target_wav=target_wav) - return wav + if self.voice_converter is None: + 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( self, source_wav: str, target_wav: str, file_path: str = "output.wav", - ): + ) -> str: """Voice conversion with FreeVC. Convert source wav to target speaker. Args: