Review record RC-028 (Go, autonomous mode, not independent). Task: MIL-006#1 Task: MIL-006#2 Task: MIL-006#3 Task: MIL-006#4 Task: MIL-006#5
23 lines
589 B
Python
23 lines
589 B
Python
"""Port for spoken words.
|
|
|
|
@file speech_port.py
|
|
@brief The SpeechPort interface the study session uses to say a word aloud.
|
|
"""
|
|
|
|
from typing import Protocol
|
|
|
|
|
|
class SpeechPort(Protocol):
|
|
"""Speaks a text aloud in a language."""
|
|
|
|
def speak(self, text: str, language_code: str) -> None:
|
|
"""Speak a text without blocking the caller for long.
|
|
|
|
An implementation does not raise: a failure is logged and ignored.
|
|
|
|
@param text The text to speak.
|
|
@param language_code Language of the text, for example "ms".
|
|
@return Nothing.
|
|
"""
|
|
...
|