I'm trying this piece of code:
from TTS.api import TTS
from TTS.utils.manage import ModelManager
from TTS.utils.synthesizer import Synthesizer
path = "C:/Users/sanca/AppData/Local/Programs/Python/Python311/Lib/site-packages/TTS/.models.json"
model_manager = ModelManager(path)
model_path, config_path, model_item = model_manager.download_model("tts_models/multilingual/multi-dataset/xtts_v2")
print(config_path)
syn = Synthesizer(
tts_checkpoint=model_path,
tts_config_path=config_path
)
text = "I am a text readed by a computer "
outputs = syn.tts(text)
syn.save_wav(outputs, "audio.wav")
However, when I try to print the config_path I get None, and that is causing everything to not work :(
I've tried to --upgrade TTS, and to change the path, this is the error I get:
> tts_models/multilingual/multi-dataset/xtts_v2 is already downloaded.
None
Traceback (most recent call last):
File "C:\Users\sanca\Documents\Bookypy\main2.py", line 13, in <module>
syn = Synthesizer(
^^^^^^^^^^^^
File "C:\Users\sanca\AppData\Local\Programs\Python\Python311\Lib\site-packages\TTS\utils\synthesizer.py", line 93, in __init__
self._load_tts(tts_checkpoint, tts_config_path, use_cuda)
File "C:\Users\sanca\AppData\Local\Programs\Python\Python311\Lib\site-packages\TTS\utils\synthesizer.py", line 183, in _load_tts
self.tts_config = load_config(tts_config_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\sanca\AppData\Local\Programs\Python\Python311\Lib\site-packages\TTS\config\__init__.py", line 85, in load_config
ext = os.path.splitext(config_path)[1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen ntpath>", line 232, in splitext
TypeError: expected str, bytes or os.PathLike object, not NoneType
Thx in advance.