@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.
Files changed (3) hide show
  1. package/dist/vapi.js +2 -1
  2. package/package.json +1 -1
  3. 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
- if (!isSpeaking)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.238",
3
+ "version": "1.0.239",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
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
- if (!isSpeaking) return;
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);