def speak(self, text):
if not self.is_valid_string(text):<EOL><INDENT>raise Exception("<STR_LIT>" % (text))<EOL><DEDENT>if len(text) > <NUM_LIT>:<EOL><INDENT>lines = self.word_wrap(text, width=<NUM_LIT>)<EOL>for line in lines:<EOL><INDENT>self.queue.put("<STR_LIT>" % (line))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.queue.put("<STR_LIT>" % (text))<EOL><DEDENT>
The main function to convert text into speech.