karen.speaker.Speaker

Speaker device to convert any text to speech send to the audio output device.

__init__(self, callback=None) special

Speaker Initialization

Parameters:
  • callback (function) – Callback function for which to send any captured data.

say(self, text)

Sends text to the festival executable to be translated and sent to the audio device.

Parameters:
  • text (str) – The text to convert into speech.

Returns:
  • (bool) – True on success else raises exception.

start(self, useThreads=True)

Starts the speaker. Function provided for compatibility as speaker does not require a daemon.

Parameters:
  • useThreads (bool) – Indicates if the brain should be started on a new thread.

Returns:
  • (bool) – True on success else will raise an exception.

stop(self)

Stops the speaker. Function provided for compatibility as speaker does not require a daemon.

Returns:
  • (bool) – True on success else will raise an exception.

wait(self, seconds=0)

Waits for any active speakders to complete before closing. Provided for compatibility as speaker does not requrie a daemon.

Parameters:
  • seconds (int) – Number of seconds to wait before calling the "stop()" function

Returns:
  • (bool) – True on success else will raise an exception.