art-from-the-machine / Mantella

Mantella is a Skyrim and Fallout 4 mod which allows you to naturally speak to NPCs using Whisper (speech-to-text), LLMs (text generation), and xVASynth / XTTS (text-to-speech).
https://art-from-the-machine.github.io/Mantella/
GNU Affero General Public License v3.0
169 stars 42 forks source link

xVASynth Error with samplerate #335

Open art-from-the-machine opened 1 month ago

art-from-the-machine commented 1 month ago

Text-To-Speech Error: Cannot access local variable 'samplerate' where it is not associated with a value

Leidtier commented 1 month ago

I wasn't able to reproduce but I made an attempt to fix this here: #334

I assume it happens here if the batch synth fails before that for what ever reason and there is no file to read the samplerate from. The try/catch block catches this but the subsequent call to write requires the samplerate that does not exist. Pulling the write into the try/catch should fix this.