1 //Create a class for speech synthesis
2 package SpeechSynthesis
3 import Timer.SimulatedTimer
5 public class SpeechSynthesises {
6 private int deviceNumbers
7 private List speechSynthesises
10 //For one device(We cannot have obj.id)-> We should have obj[0].id
11 private String id = "speechSynthesisID0"
12 private String label = "speechSynthesis0"
13 private String displayName = "speechSynthesis0"
14 private int level = 50
17 SpeechSynthesises(Closure sendEvent, int deviceNumbers) {
18 this.sendEvent = sendEvent
19 this.deviceNumbers = deviceNumbers
20 this.speechSynthesises = []
22 speechSynthesises.add(new SpeechSynthesis(id, label, displayName, this.level))
25 //Methods for closures
26 def count(Closure Input) {
27 speechSynthesises.count(Input)
30 speechSynthesises.size()
32 def each(Closure Input) {
33 speechSynthesises.each(Input)
35 def find(Closure Input) {
36 speechSynthesises.find(Input)
38 def collect(Closure Input) {
39 speechSynthesises.collect(Input)
42 def setLevel(int level) {
43 speechSynthesises[0].setLevel(level)
47 def speak(String message) {
48 speechSynthesises[0].speak(message)