@vapi-ai/web 1.0.245 → 1.0.247
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.d.ts +1 -0
- package/dist/vapi.js +4 -1
- package/package.json +1 -1
- package/vapi.ts +4 -2
package/dist/vapi.d.ts
CHANGED
package/dist/vapi.js
CHANGED
|
@@ -171,7 +171,6 @@ class Vapi extends VapiEventEmitter {
|
|
|
171
171
|
}
|
|
172
172
|
handleRemoteParticipantsAudioLevel(e) {
|
|
173
173
|
const speechLevel = Object.values(e.participantsAudioLevel).reduce((a, b) => a + b, 0);
|
|
174
|
-
console.log(speechLevel);
|
|
175
174
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
176
175
|
const isSpeaking = speechLevel > 0.01;
|
|
177
176
|
if (!isSpeaking)
|
|
@@ -194,5 +193,9 @@ class Vapi extends VapiEventEmitter {
|
|
|
194
193
|
(_a = this.call) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
195
194
|
this.call = null;
|
|
196
195
|
}
|
|
196
|
+
send(message) {
|
|
197
|
+
var _a;
|
|
198
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.sendAppMessage(message);
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
exports.default = Vapi;
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -212,8 +212,6 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
212
212
|
0
|
|
213
213
|
);
|
|
214
214
|
|
|
215
|
-
console.log(speechLevel);
|
|
216
|
-
|
|
217
215
|
this.emit("volume-level", Math.min(1, speechLevel / 0.15));
|
|
218
216
|
|
|
219
217
|
const isSpeaking = speechLevel > 0.01;
|
|
@@ -238,4 +236,8 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
238
236
|
this.call?.destroy();
|
|
239
237
|
this.call = null;
|
|
240
238
|
}
|
|
239
|
+
|
|
240
|
+
send(message: any): void {
|
|
241
|
+
this.call?.sendAppMessage(message);
|
|
242
|
+
}
|
|
241
243
|
}
|