@vapi-ai/web 1.0.243 → 1.0.244
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 +1 -2
- package/package.json +1 -1
- package/vapi.ts +1 -3
package/dist/vapi.js
CHANGED
|
@@ -175,9 +175,8 @@ class Vapi extends VapiEventEmitter {
|
|
|
175
175
|
const speechLevel = Object.values(e.participantsAudioLevel).reduce((a, b) => a + b, 0);
|
|
176
176
|
this.averageSpeechLevel =
|
|
177
177
|
this.averageSpeechLevel * 0.95 + speechLevel * 0.05;
|
|
178
|
-
this.speechLevel = this.speechLevel * 0.
|
|
178
|
+
this.speechLevel = this.speechLevel * 0.92 + speechLevel * 0.08;
|
|
179
179
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
180
|
-
console.log(this.averageSpeechLevel, this.speechLevel);
|
|
181
180
|
const hasStartedSpeaking = this.speechLevel > this.averageSpeechLevel * 1.5;
|
|
182
181
|
const hasStoppedSpeaking = this.speechLevel < this.averageSpeechLevel * 0.5;
|
|
183
182
|
if (!this.isSpeaking && hasStartedSpeaking) {
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -215,12 +215,10 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
215
215
|
);
|
|
216
216
|
this.averageSpeechLevel =
|
|
217
217
|
this.averageSpeechLevel * 0.95 + speechLevel * 0.05;
|
|
218
|
-
this.speechLevel = this.speechLevel * 0.
|
|
218
|
+
this.speechLevel = this.speechLevel * 0.92 + speechLevel * 0.08;
|
|
219
219
|
|
|
220
220
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
221
221
|
|
|
222
|
-
console.log(this.averageSpeechLevel, this.speechLevel);
|
|
223
|
-
|
|
224
222
|
const hasStartedSpeaking = this.speechLevel > this.averageSpeechLevel * 1.5;
|
|
225
223
|
const hasStoppedSpeaking = this.speechLevel < this.averageSpeechLevel * 0.5;
|
|
226
224
|
|