Merge branch 'master' of ssh://plrg.eecs.uci.edu/home/git/smartthings-infrastructure
[smartthings-infrastructure.git] / SpeechSynthesis / SpeechSynthesis.groovy
1 //Create a class for speech synthesis
2 package SpeechSynthesis
3 import Timer.SimulatedTimer
4
5 public class SpeechSynthesis {
6         private String id
7         private String label
8         private String displayName
9         private int level
10
11
12         SpeechSynthesis(String id, String label, String displayName, int level) {
13                 this.id = id
14                 this.label = label
15                 this.displayName = displayName
16                 this.level = level
17         }
18
19         def setLevel(int level) {
20                 println("The level of speech synthesis with id:$id is changed to $level")
21                 this.level = level
22         }
23
24         def speak(String message) {
25                 println("Speech synthesis with id:$id, SPEAKING:\"$message\"!")
26         }
27 }