-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpeechSynthesis.cljs
178 lines (125 loc) · 5.31 KB
/
SpeechSynthesis.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
(ns web.speech.SpeechSynthesis
"The SpeechSynthesis interface of the Web Speech API is the controller
for the speech service; this can be used to retrieve information
the synthesis voices available on the device, start and pause
and other commands besides."
(:refer-clojure :exclude []))
(defn cancel
"Method.
The cancel() method of the `web.speech.SpeechSynthesis` interface
all utterances from the utterance queue.
`speechSynthesisInstance.cancel();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/cancel`"
[this ]
(-> this (.cancel)))
(defn get-voices
"Method.
The getVoices() method of the `web.speech.SpeechSynthesis` interface
a list of `web.speech.SpeechSynthesisVoice` objects representing
the available voices on the current device.
`speechSynthesisInstance.getVoices();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/getVoices`"
[this ]
(-> this (.getVoices)))
(defn pause
"Method.
The pause() method of the `web.speech.SpeechSynthesis` interface
the SpeechSynthesis object into a paused state.
`speechSynthesisInstance.pause();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/pause`"
[this ]
(-> this (.pause)))
(defn resume
"Method.
The resume() method of the `web.speech.SpeechSynthesis` interface
the SpeechSynthesis object into a non-paused state: resumes it
it was already paused.
`speechSynthesisInstance.resume();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/resume`"
[this ]
(-> this (.resume)))
(defn speak
"Method.
The speak() method of the `web.speech.SpeechSynthesis` interface
an `utterance` to the utterance queue; it will be spoken when
other utterances queued before it have been spoken.
`speechSynthesisInstance.speak(utterance);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/speak`"
[this utterance]
(-> this (.speak utterance)))
(defn paused
"Property.
The paused read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if the SpeechSynthesis object
in a paused state, or false if not.
`var amIPaused = speechSynthesisInstance.paused;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/paused`"
[this]
(-> this (.-paused)))
(defn set-paused!
"Property.
The paused read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if the SpeechSynthesis object
in a paused state, or false if not.
`var amIPaused = speechSynthesisInstance.paused;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/paused`"
[this val]
(aset this "paused" val))
(defn pending
"Property.
The pending read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if the utterance queue contains
utterances.
`var amIPending = speechSynthesisInstance.pending;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/pending`"
[this]
(-> this (.-pending)))
(defn set-pending!
"Property.
The pending read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if the utterance queue contains
utterances.
`var amIPending = speechSynthesisInstance.pending;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/pending`"
[this val]
(aset this "pending" val))
(defn speaking
"Property.
The speaking read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if an utterance is currently
the process of being spoken — even if SpeechSynthesis is in a
state.
`var amISpeaking = speechSynthesisInstance.speaking;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/speaking`"
[this]
(-> this (.-speaking)))
(defn set-speaking!
"Property.
The speaking read-only property of the `web.speech.SpeechSynthesis`
is a `js.Boolean` that returns true if an utterance is currently
the process of being spoken — even if SpeechSynthesis is in a
state.
`var amISpeaking = speechSynthesisInstance.speaking;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/speaking`"
[this val]
(aset this "speaking" val))
(defn onvoiceschanged
"Property.
The onvoiceschanged property of the `web.speech.SpeechSynthesis`
represents an event handler that will run when the list of `web.speech.SpeechSynthesisVoice`
that would be returned by the `SpeechSynthesis.getVoices()` method
changed (when the voiceschanged event fires.)
`speechSynthesisInstance.onvoiceschanged = function() { ... };`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/onvoiceschanged`"
[this]
(-> this (.-onvoiceschanged)))
(defn set-onvoiceschanged!
"Property.
The onvoiceschanged property of the `web.speech.SpeechSynthesis`
represents an event handler that will run when the list of `web.speech.SpeechSynthesisVoice`
that would be returned by the `SpeechSynthesis.getVoices()` method
changed (when the voiceschanged event fires.)
`speechSynthesisInstance.onvoiceschanged = function() { ... };`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/onvoiceschanged`"
[this val]
(aset this "onvoiceschanged" val))