@vapi-ai/web 1.0.240 → 1.0.242
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,8 +175,9 @@ 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.8 + speechLevel * 0.
|
|
178
|
+
this.speechLevel = this.speechLevel * 0.8 + speechLevel * 0.2;
|
|
179
179
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
180
|
+
console.log(this.averageSpeechLevel, this.speechLevel);
|
|
180
181
|
const hasStartedSpeaking = this.speechLevel > this.averageSpeechLevel * 1.5;
|
|
181
182
|
const hasStoppedSpeaking = this.speechLevel < this.averageSpeechLevel * 0.5;
|
|
182
183
|
if (!this.isSpeaking && hasStartedSpeaking) {
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -215,10 +215,12 @@ 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.8 + speechLevel * 0.
|
|
218
|
+
this.speechLevel = this.speechLevel * 0.8 + speechLevel * 0.2;
|
|
219
219
|
|
|
220
220
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
221
221
|
|
|
222
|
+
console.log(this.averageSpeechLevel, this.speechLevel);
|
|
223
|
+
|
|
222
224
|
const hasStartedSpeaking = this.speechLevel > this.averageSpeechLevel * 1.5;
|
|
223
225
|
const hasStoppedSpeaking = this.speechLevel < this.averageSpeechLevel * 0.5;
|
|
224
226
|
|