@vapi-ai/web 1.0.238 → 1.0.239
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/vapi.js +2 -1
- package/package.json +1 -1
- package/vapi.ts +3 -1
package/dist/vapi.js
CHANGED
|
@@ -175,7 +175,8 @@ class Vapi extends VapiEventEmitter {
|
|
|
175
175
|
this.averageSpeechLevel * 0.95 + speechLevel * 0.05;
|
|
176
176
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
177
177
|
const isSpeaking = speechLevel > this.averageSpeechLevel * 1.5;
|
|
178
|
-
|
|
178
|
+
const hasStoppedSpeaking = speechLevel < this.averageSpeechLevel * 0.5;
|
|
179
|
+
if (!isSpeaking && !hasStoppedSpeaking)
|
|
179
180
|
return;
|
|
180
181
|
if (this.speakingTimeout) {
|
|
181
182
|
clearTimeout(this.speakingTimeout);
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -217,7 +217,9 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
217
217
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
218
218
|
|
|
219
219
|
const isSpeaking = speechLevel > this.averageSpeechLevel * 1.5;
|
|
220
|
-
|
|
220
|
+
const hasStoppedSpeaking = speechLevel < this.averageSpeechLevel * 0.5;
|
|
221
|
+
|
|
222
|
+
if (!isSpeaking && !hasStoppedSpeaking) return;
|
|
221
223
|
|
|
222
224
|
if (this.speakingTimeout) {
|
|
223
225
|
clearTimeout(this.speakingTimeout);
|