pylips.speech.SystemTTS

class pylips.speech.SystemTTS[source]

A text-to-speech backend that uses the system’s default TTS engine.

Parameters

None

__init__()[source]

Methods

__init__()

gen_audio_and_visemes(text[, voice_id, fname])

Generates audio and visemes from a string of text using the system's default TTS engine.

get_audio_and_visemes(fname)

Gets the audio and visemes from a file that was previously generated.

list_voices()

Lists all the voices that are available in the system's default TTS backend.

gen_audio_and_visemes(text, voice_id=None, fname=None)[source]

Generates audio and visemes from a string of text using the system’s default TTS engine.

Parameters
  • text (str) – the text that the robot should speak

  • voice_id (str) – the voice that the robot should speak in

  • fname (str) – the name of the file that the audio should be saved to

Returns

a tuple containing fname, times, and visemes. fname is the path to the audio file, times is a list of times that correspond to the initiation of the visemes, and visemes is a list of visemes that correspond to the words in the audio

Return type

(tuple)

Raises

Exception – if the voice_id is not in the list of available voices

get_audio_and_visemes(fname)[source]

Gets the audio and visemes from a file that was previously generated.

Parameters

fname (str) – the name of the file that the audio and visemes were saved to. It is not necessary to include the file extension.

Returns

a tuple containing fname, times, and visemes. fname is the path to the audio file, times is a list of times that correspond to the initiation of the visemes, and visemes is a list of visemes that correspond to the words in the audio

Return type

(tuple)

list_voices()[source]

Lists all the voices that are available in the system’s default TTS backend.

Parameters

None