Module speechlight.dummy
¶
Dummy speech.
Class Speech(BaseSpeech)
¶
Implements Speech for the dummy platform.
Source code in speechlight/dummy.py
class Speech(BaseSpeech):
"""Implements Speech for the dummy platform."""
def braille(self, text: str) -> None: # NOQA: D102
pass
def output(self, text: str, *, interrupt: bool = False) -> None: # NOQA: D102
self.say(text, interrupt=interrupt)
self.braille(text)
def say(self, text: str, *, interrupt: bool = False) -> None: # NOQA: D102
if interrupt:
self.silence()
def silence(self) -> None: # NOQA: D102
pass
def speaking(self) -> bool: # NOQA: D102, PLR6301
return False
Method braille(self, text)
¶
Brailles text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str |
The text to be brailled. |
required |
Source code in speechlight/dummy.py
def braille(self, text: str) -> None: # NOQA: D102
pass
Method output(self, text, *, interrupt=False)
¶
Speaks and brailles text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str |
The output text. |
required |
interrupt |
bool |
True if the speech should be silenced before speaking. |
False |
Source code in speechlight/dummy.py
def output(self, text: str, *, interrupt: bool = False) -> None: # NOQA: D102
self.say(text, interrupt=interrupt)
self.braille(text)
Method say(self, text, *, interrupt=False)
¶
Speaks text.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str |
The text to be spoken. |
required |
interrupt |
bool |
True if the speech should be silenced before speaking. |
False |
Source code in speechlight/dummy.py
def say(self, text: str, *, interrupt: bool = False) -> None: # NOQA: D102
if interrupt:
self.silence()
Method silence(self)
¶
Cancels speech and flushes the speech buffer.
Source code in speechlight/dummy.py
def silence(self) -> None: # NOQA: D102
pass
Method speaking(self)
¶
Determines if text is currently being spoken.
Returns:
Type | Description |
---|---|
bool |
True if text is currently being spoken, False otherwise. |
Source code in speechlight/dummy.py
def speaking(self) -> bool: # NOQA: D102, PLR6301
return False