mirror of
https://github.com/storytold/storyteller-ml.git
synced 2026-10-18 00:33:15 +00:00
Add SadTalker @ ae0b26359d44c9379450a8e02a38b45eeec15549
MIT license Commit: https://github.com/OpenTalker/SadTalker commit ae0b26359d44c9379450a8e02a38b45eeec15549 (HEAD -> main, origin/main, origin/HEAD) Author: shadowcun <shadowcun@tencent.com> Date: Mon Jul 3 13:48:35 2023 +0800 fixed bug: hacking facexlib of FAN
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import os
|
||||
import tempfile
|
||||
from TTS.api import TTS
|
||||
|
||||
|
||||
class TTSTalker():
|
||||
def __init__(self) -> None:
|
||||
model_name = TTS.list_models()[0]
|
||||
self.tts = TTS(model_name)
|
||||
|
||||
def test(self, text, language='en'):
|
||||
|
||||
tempf = tempfile.NamedTemporaryFile(
|
||||
delete = False,
|
||||
suffix = ('.'+'wav'),
|
||||
)
|
||||
|
||||
self.tts.tts_to_file(text, speaker=self.tts.speakers[0], language=language, file_path=tempf.name)
|
||||
|
||||
return tempf.name
|
||||
Reference in New Issue
Block a user