Text to Speech (TTS)

Clients

Manager

This module contains the Spokestack text to speech manager which handles a text to speech client, decodes the returned audio, and writes the audio to the specified output.

class spokestack.tts.manager.SequenceIO(sequence)[source]

Wrapper that allows for incrementally received audio to be decoded.

class spokestack.tts.manager.TextToSpeechManager(client, output)[source]

Manages tts client and io target.

Parameters
  • client (Any) – Text to speech client that returns encoded mp3 audio

  • output (Any) – Audio io target

close()[source]

Closes the client and output.

Return type

None

synthesize(utterance, mode, voice)[source]

Synthesizes the given utterance with the voice and format provided.

Parameters
  • utterance (str) – string that needs to be rendered as speech.

  • mode (str) – synthesis mode to use with utterance. text, ssml, markdown, etc.

  • voice (str) – name of the tts voice.

Return type

None