@onereach/step-voice 7.0.2-processttschunk.12 → 7.0.2-processttschunk.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,10 +3,9 @@ interface INPUT {
|
|
|
3
3
|
voiceId: string;
|
|
4
4
|
infiniteProcessing: boolean;
|
|
5
5
|
asr: TODO;
|
|
6
|
+
endpointing: number | false;
|
|
6
7
|
}
|
|
7
8
|
interface EVENT extends VoiceEvent {
|
|
8
|
-
digit?: string;
|
|
9
|
-
digits?: string;
|
|
10
9
|
phrases?: TODO[];
|
|
11
10
|
}
|
|
12
11
|
export default class StartTTSChunksProcessing extends VoiceStep<INPUT, {}, EVENT> {
|
|
@@ -5,10 +5,13 @@ const voice_1 = tslib_1.__importDefault(require("./voice"));
|
|
|
5
5
|
class StartTTSChunksProcessing extends voice_1.default {
|
|
6
6
|
async runStep() {
|
|
7
7
|
const call = await this.fetchData();
|
|
8
|
-
const { voiceId, infiniteProcessing, asr } = this.data;
|
|
8
|
+
const { voiceId, infiniteProcessing, asr, endpointing } = this.data;
|
|
9
9
|
const grammar = {
|
|
10
10
|
id: this.currentStepId,
|
|
11
|
-
asr:
|
|
11
|
+
asr: {
|
|
12
|
+
...asr.getSettings(call.asr),
|
|
13
|
+
endpointing
|
|
14
|
+
},
|
|
12
15
|
};
|
|
13
16
|
const command = {
|
|
14
17
|
name: 'start-TTS-chunks-processing',
|
|
@@ -25,14 +28,16 @@ class StartTTSChunksProcessing extends voice_1.default {
|
|
|
25
28
|
this.log.info('tts-chunks-playback-done', event.params);
|
|
26
29
|
return this.exitStep('next', {}, false);
|
|
27
30
|
}
|
|
31
|
+
case 'timeout': {
|
|
32
|
+
this.log.info('timeout', event.params);
|
|
33
|
+
return this.exitStep(event.params.type, {}, false);
|
|
34
|
+
}
|
|
28
35
|
case 'recognition': {
|
|
29
36
|
this.log.info('recognition', event.params);
|
|
30
37
|
const params = event.params;
|
|
31
|
-
// const phrases = params.phrases
|
|
32
|
-
const exitId = 'interruption';
|
|
33
38
|
const exitData = this.exitChoiceData('voice', params);
|
|
34
39
|
this.log.info('exitData', exitData);
|
|
35
|
-
return this.exitStep(
|
|
40
|
+
return this.exitStep(event.params.type, exitData, false);
|
|
36
41
|
}
|
|
37
42
|
case 'hangup': {
|
|
38
43
|
await this.handleHangup(call);
|