@adminforth/agent 1.41.1 → 1.41.2

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/build.log CHANGED
@@ -58,5 +58,5 @@ custom/speech_recognition_frontend/voiceActivityDetection.ts
58
58
  custom/speech_recognition_frontend/types/
59
59
  custom/speech_recognition_frontend/types/voice-activity-detection.d.ts
60
60
 
61
- sent 1,660,143 bytes received 856 bytes 3,321,998.00 bytes/sec
62
- total size is 1,656,231 speedup is 1.00
61
+ sent 1,660,284 bytes received 860 bytes 3,322,288.00 bytes/sec
62
+ total size is 1,656,368 speedup is 1.00
@@ -15,7 +15,7 @@ type StreamingAudioState = {
15
15
  };
16
16
 
17
17
  let standByAudio: HTMLAudioElement | null = null;
18
-
18
+ let isStandByAudioPlaying = false;
19
19
  function playStandByAudio() {
20
20
  if (!standByAudio) {
21
21
  standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
@@ -27,6 +27,7 @@ function playStandByAudio() {
27
27
  }
28
28
  standByAudio.currentTime = 0;
29
29
  standByAudio.play()
30
+ isStandByAudioPlaying = true;
30
31
  }
31
32
 
32
33
  function stopStandByAudio() {
@@ -35,6 +36,7 @@ function stopStandByAudio() {
35
36
  }
36
37
  standByAudio.pause();
37
38
  standByAudio.currentTime = 0;
39
+ isStandByAudioPlaying = false;
38
40
  }
39
41
 
40
42
  function restartStandByAudio() {
@@ -197,7 +199,9 @@ export const useAgentAudio = defineStore('agentAudio', () => {
197
199
  }
198
200
 
199
201
  if (event.type === 'data-tool-call') {
200
- playStandByAudio();
202
+ if (!isStandByAudioPlaying) {
203
+ playStandByAudio();
204
+ }
201
205
  agentStore.addDataToolCallMessage(event.data);
202
206
  }
203
207
  }
@@ -94,8 +94,8 @@ function toggleChatMode() {
94
94
 
95
95
  async function onStartRecording() {
96
96
  await requestMicAndStartVAD(saidSomething, stopRecording, onAnySound);
97
- microphoneButtonMode.value = 'listen';
98
- agentAudio.playBeep(1000);
97
+ microphoneButtonMode.value = 'listen';
98
+ agentAudio.playBeep(1000);
99
99
  }
100
100
 
101
101
  function onStopRecording() {
@@ -15,7 +15,7 @@ type StreamingAudioState = {
15
15
  };
16
16
 
17
17
  let standByAudio: HTMLAudioElement | null = null;
18
-
18
+ let isStandByAudioPlaying = false;
19
19
  function playStandByAudio() {
20
20
  if (!standByAudio) {
21
21
  standByAudio = new Audio(`/plugins/AdminForthAgentPlugin/agentAudio/agent-processing.mp3`);
@@ -27,6 +27,7 @@ function playStandByAudio() {
27
27
  }
28
28
  standByAudio.currentTime = 0;
29
29
  standByAudio.play()
30
+ isStandByAudioPlaying = true;
30
31
  }
31
32
 
32
33
  function stopStandByAudio() {
@@ -35,6 +36,7 @@ function stopStandByAudio() {
35
36
  }
36
37
  standByAudio.pause();
37
38
  standByAudio.currentTime = 0;
39
+ isStandByAudioPlaying = false;
38
40
  }
39
41
 
40
42
  function restartStandByAudio() {
@@ -197,7 +199,9 @@ export const useAgentAudio = defineStore('agentAudio', () => {
197
199
  }
198
200
 
199
201
  if (event.type === 'data-tool-call') {
200
- playStandByAudio();
202
+ if (!isStandByAudioPlaying) {
203
+ playStandByAudio();
204
+ }
201
205
  agentStore.addDataToolCallMessage(event.data);
202
206
  }
203
207
  }
@@ -94,8 +94,8 @@ function toggleChatMode() {
94
94
 
95
95
  async function onStartRecording() {
96
96
  await requestMicAndStartVAD(saidSomething, stopRecording, onAnySound);
97
- microphoneButtonMode.value = 'listen';
98
- agentAudio.playBeep(1000);
97
+ microphoneButtonMode.value = 'listen';
98
+ agentAudio.playBeep(1000);
99
99
  }
100
100
 
101
101
  function onStopRecording() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.41.1",
3
+ "version": "1.41.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",