custom voice handling

This commit is contained in:
Concedo 2025-08-18 16:57:34 +08:00
parent 67ef5e6c02
commit 2abe11071b
3 changed files with 31 additions and 17 deletions

View file

@ -352,6 +352,7 @@ class tts_generation_inputs(ctypes.Structure):
_fields_ = [("prompt", ctypes.c_char_p),
("speaker_seed", ctypes.c_int),
("audio_seed", ctypes.c_int),
("custom_speaker_voice", ctypes.c_char_p),
("custom_speaker_text", ctypes.c_char_p),
("custom_speaker_data", ctypes.c_char_p)]
@ -1880,6 +1881,7 @@ def tts_generate(genparams):
else:
voice = simple_lcg_hash(voicestr.strip()) if voicestr else 1
inputs = tts_generation_inputs()
inputs.custom_speaker_voice = normalized_voice.encode("UTF-8")
inputs.prompt = prompt.encode("UTF-8")
inputs.speaker_seed = voice
aseed = -1