askbob.speech package¶
Subpackages¶
Submodules¶
askbob.speech.synthesiser module¶
-
class
askbob.speech.synthesiser.
TextToSpeechService
(voice_id: Optional[str] = None)¶ Bases:
object
The TextToSpeechService is responsible for speech synthesis.
-
say
(text: str) → None¶ Converts the text into speech and outputs the audio.
- Parameters
text (str) – The text to say.
-
tts
: pyttsx3.engine.Engine¶
-
askbob.speech.transcriber module¶
-
class
askbob.speech.transcriber.
Transcriber
(model: str, scorer: str, us: askbob.speech.listener.listener.UtteranceService, save_path: Optional[str] = None)¶ Bases:
object
The transcriber performs speech-to-text on captured utterances spoken by the user.
-
init_deepspeech
(model_path: str, scorer_path: str = '') → deepspeech.Model¶ Initialises the DeepSpeech model.
- Parameters
model_path (str) – The path to the DeepSpech model.
scorer_path (str, optional) – The path to an external scorer. Defaults to “”.
- Returns
The DeepSpeech model.
- Return type
deepspeech.Model
-
transcribe
()¶ Transcribes spoken words.
- Yields
TranscriptionEvent – Whether the utterance has started or ended. str: The transcribed phrase spoken by the user.
-