@absolutejs/voice 0.0.22-beta.544 → 0.0.22-beta.545

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.
package/dist/index.js CHANGED
@@ -4888,6 +4888,9 @@ var createVoiceSession = (options) => {
4888
4888
  };
4889
4889
  };
4890
4890
  const handlePartial = async (transcript) => {
4891
+ if (activeTTSTurnId !== undefined && transcript.text.trim()) {
4892
+ cancelActiveTTS("barge-in");
4893
+ }
4891
4894
  const session = await writeSession((session2) => {
4892
4895
  const nextPartialStartedAt = transcript.startedAtMs ?? session2.currentTurn.partialStartedAt;
4893
4896
  const nextPartialEndedAt = transcript.endedAtMs ?? session2.currentTurn.partialEndedAt;
@@ -5661,9 +5664,6 @@ var createVoiceSession = (options) => {
5661
5664
  if (amdFirstAudioAt === undefined) {
5662
5665
  amdFirstAudioAt = Date.now();
5663
5666
  }
5664
- if (!speechDetected && activeTTSTurnId !== undefined) {
5665
- cancelActiveTTS("barge-in");
5666
- }
5667
5667
  speechDetected = true;
5668
5668
  clearSilenceTimer();
5669
5669
  kickCallSilenceWatchdog();
@@ -6750,6 +6750,9 @@ var createVoiceSession = (options) => {
6750
6750
  };
6751
6751
  };
6752
6752
  const handlePartial = async (transcript) => {
6753
+ if (activeTTSTurnId !== undefined && transcript.text.trim()) {
6754
+ cancelActiveTTS("barge-in");
6755
+ }
6753
6756
  const session = await writeSession((session2) => {
6754
6757
  const nextPartialStartedAt = transcript.startedAtMs ?? session2.currentTurn.partialStartedAt;
6755
6758
  const nextPartialEndedAt = transcript.endedAtMs ?? session2.currentTurn.partialEndedAt;
@@ -7523,9 +7526,6 @@ var createVoiceSession = (options) => {
7523
7526
  if (amdFirstAudioAt === undefined) {
7524
7527
  amdFirstAudioAt = Date.now();
7525
7528
  }
7526
- if (!speechDetected && activeTTSTurnId !== undefined) {
7527
- cancelActiveTTS("barge-in");
7528
- }
7529
7529
  speechDetected = true;
7530
7530
  clearSilenceTimer();
7531
7531
  kickCallSilenceWatchdog();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.544",
3
+ "version": "0.0.22-beta.545",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",