@onereach/step-voice 7.0.9-processttschunk.20 → 7.0.9-processttschunk.22

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.
@@ -1,15 +1,15 @@
1
1
  import VoiceStep, { TODO, VoiceEvent } from './voice';
2
2
  interface INPUT {
3
- voiceId: string;
3
+ voiceId?: string;
4
4
  infiniteProcessing: boolean;
5
5
  asr: TODO;
6
6
  endpointing: number;
7
- voiceSettings: any;
8
- queryParams: any;
7
+ voiceSettings?: any;
8
+ queryParams?: any;
9
9
  minConfidence: number;
10
- /** `true` → ElevenLabs stream (`playbackMode: 'chunks'`). `false` → synthesize + playback per phrase (`phrases`). */
11
10
  chunksStreamingEnabled: boolean;
12
11
  tts?: TODO;
12
+ postPlaybackSilenceMs?: number;
13
13
  confirmationConfidence?: number;
14
14
  }
15
15
  interface EVENT extends VoiceEvent {
@@ -5,7 +5,7 @@ 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, asr, endpointing, minConfidence, confirmationConfidence, voiceSettings: getSettings, queryParams: getParams, chunksStreamingEnabled, tts } = this.data;
8
+ const { voiceId, asr, endpointing, minConfidence, confirmationConfidence, voiceSettings: getSettings, queryParams: getParams, chunksStreamingEnabled, tts, postPlaybackSilenceMs } = this.data;
9
9
  const grammar = {
10
10
  id: this.currentStepId,
11
11
  asr: {
@@ -15,8 +15,6 @@ class StartTTSChunksProcessing extends voice_1.default {
15
15
  }
16
16
  }
17
17
  };
18
- const voiceSettings = await getSettings.call(this);
19
- const queryParams = await getParams.call(this);
20
18
  const base = {
21
19
  grammar,
22
20
  minConfidence,
@@ -24,6 +22,8 @@ class StartTTSChunksProcessing extends voice_1.default {
24
22
  };
25
23
  let params;
26
24
  if (chunksStreamingEnabled) {
25
+ const voiceSettings = await getSettings.call(this);
26
+ const queryParams = await getParams.call(this);
27
27
  params = {
28
28
  ...base,
29
29
  playbackMode: 'chunks',
@@ -36,7 +36,8 @@ class StartTTSChunksProcessing extends voice_1.default {
36
36
  params = {
37
37
  ...base,
38
38
  playbackMode: 'phrases',
39
- phraseTtsSettings: tts.getSettings(call.tts)
39
+ phraseTtsSettings: tts.getSettings(call.tts),
40
+ ...(postPlaybackSilenceMs !== undefined ? { postPlaybackSilenceMs } : {})
40
41
  };
41
42
  }
42
43
  const command = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "7.0.9-processttschunk.20",
3
+ "version": "7.0.9-processttschunk.22",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",