Improve type support a bit more (#333)

Also fix default voice for util.py

Signed-off-by: rany <rany2@riseup.net>
This commit is contained in:
Rany
2024-11-23 19:59:39 +02:00
committed by GitHub
parent a3d468c7c9
commit 063957683c
7 changed files with 57 additions and 32 deletions

View File

@@ -78,15 +78,24 @@ class Voice(TypedDict):
VoiceTag: VoiceTag
class VoiceManagerVoice(Voice):
"""Voice data for VoiceManager."""
class VoicesManagerVoice(Voice):
"""Voice data for VoicesManager."""
Language: str
class VoiceManagerFind(TypedDict):
"""Voice data for VoiceManager.find()."""
class VoicesManagerFind(TypedDict):
"""Voice data for VoicesManager.find()."""
Gender: NotRequired[Literal["Female", "Male"]]
Locale: NotRequired[str]
Language: NotRequired[str]
class CommunicateState(TypedDict):
"""Communicate state data."""
partial_text: bytes
offset_compensation: float
last_duration_offset: float
stream_was_called: bool