-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathSpeechSynthesisAudioStreamUtterance.mjs
More file actions
49 lines (37 loc) · 1.14 KB
/
SpeechSynthesisAudioStreamUtterance.mjs
File metadata and controls
49 lines (37 loc) · 1.14 KB
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
import EventTarget, { getEventAttributeValue, setEventAttributeValue } from 'event-target-shim';
class SpeechSynthesisAudioStreamUtterance extends EventTarget {
constructor(audioStream) {
super();
if (audioStream && !(audioStream.format && typeof audioStream.read === 'function')) {
throw new Error(
'botframework-directlinespeech-sdk: If the first argument is specified, it must be a Cognitive Services audio stream.'
);
}
this.audioStream = audioStream;
}
get onboundary() {
return getEventAttributeValue(this, 'boundary');
}
set onboundary(value) {
setEventAttributeValue(this, 'boundary', value);
}
get onend() {
return getEventAttributeValue(this, 'end');
}
set onend(value) {
setEventAttributeValue(this, 'end', value);
}
get onerror() {
return getEventAttributeValue(this, 'error');
}
set onerror(value) {
setEventAttributeValue(this, 'error', value);
}
get onstart() {
return getEventAttributeValue(this, 'start');
}
set onstart(value) {
setEventAttributeValue(this, 'start', value);
}
}
export default SpeechSynthesisAudioStreamUtterance;