Beispiel #1
0
 public function say()
 {
     $text = $_POST['text'];
     $speakObject = new SpeakObject();
     $speakObject->addText($text);
     $speaker = new Speaker();
     $speaker->speak($speakObject);
 }
Beispiel #2
0
 public function speak(SpeakObject $object)
 {
     $text = $object->getText();
     $this->parseVoice($text);
     $voice = $object->getVoice();
     $from = $object->getFrom();
     $text = $from == null ? $text : $from . ' Says ' . $text;
     exec("espeak -k5 -s150 '{$text}' -v {$voice}");
 }
Beispiel #3
0
 public function post()
 {
     $text = $_POST['text'];
     $speakObject = new SpeakObject();
     $speakObject->setFrom($_SESSION['name']);
     $speakObject->addText($text);
     $speaker = new Speaker();
     $speaker->speak($speakObject);
 }