Add support for gender and google_style inputs to Google TTS
This commit is contained in:
@@ -558,6 +558,8 @@ class TTSUpdateSettingsFrame(ControlFrame):
|
||||
style: Optional[str] = None
|
||||
style_degree: Optional[str] = None
|
||||
role: Optional[str] = None
|
||||
gender: Optional[str] = None
|
||||
google_style: Optional[str] = None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -235,6 +235,14 @@ class TTSService(AIService):
|
||||
async def flush_audio(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def set_gender(self, gender: str):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def set_google_style(self, google_style: str):
|
||||
pass
|
||||
|
||||
# Converts the text to audio.
|
||||
@abstractmethod
|
||||
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
|
||||
|
||||
@@ -272,7 +272,7 @@ class GoogleTTSService(TTSService):
|
||||
logger.debug(f"Switch TTS gender to [{gender}]")
|
||||
self._params.gender = gender
|
||||
|
||||
async def google_style(
|
||||
async def set_google_style(
|
||||
self, google_style: Literal["apologetic", "calm", "empathetic", "firm", "lively"]
|
||||
) -> None:
|
||||
logger.debug(f"Switching TTS google style to: [{google_style}]")
|
||||
|
||||
Reference in New Issue
Block a user