1 //Create a class for speech synthesis
2 package SpeechSynthesis
3 import Timer.SimulatedTimer
6 import gov.nasa.jpf.vm.Verify
8 public class SpeechSynthesises {
9 private int deviceNumbers
10 private List speechSynthesises
13 //For one device(We cannot have obj.id)-> We should have obj[0].id
14 private String id = "speechSynthesisID0"
15 private String label = "speechSynthesis0"
16 private String displayName = "speechSynthesis0"
17 private int level = 50
20 SpeechSynthesises(Closure sendEvent, int deviceNumbers) {
21 this.sendEvent = sendEvent
22 this.deviceNumbers = deviceNumbers
23 this.speechSynthesises = []
25 //def init = Verify.getIntFromList(30, 50, 70)
28 speechSynthesises.add(new SpeechSynthesis(id, label, displayName, this.level))
31 //Methods for closures
32 def count(Closure Input) {
33 speechSynthesises.count(Input)
36 speechSynthesises.size()
38 def each(Closure Input) {
39 speechSynthesises.each(Input)
41 def find(Closure Input) {
42 speechSynthesises.find(Input)
44 def sort(Closure Input) {
45 speechSynthesises.sort(Input)
47 def collect(Closure Input) {
48 speechSynthesises.collect(Input)
51 def setLevel(int level) {
52 if (level != this.level) {
54 speechSynthesises[0].setLevel(level)
58 def speak(String message) {
59 speechSynthesises[0].speak(message)