@vapi-ai/web 1.0.170 → 1.0.172
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 +3 -2
- package/package.json +1 -1
- package/vapi.ts +3 -2
package/dist/vapi.js
CHANGED
|
@@ -43,7 +43,7 @@ class Vapi extends events_1.default {
|
|
|
43
43
|
});
|
|
44
44
|
(_a = this.call.iframe()) === null || _a === void 0 ? void 0 : _a.style.setProperty("display", "none");
|
|
45
45
|
yield this.call.join({ url });
|
|
46
|
-
this.call.startRemoteParticipantsAudioLevelObserver(
|
|
46
|
+
this.call.startRemoteParticipantsAudioLevelObserver();
|
|
47
47
|
this.call.on("remote-participants-audio-level", this.handleRemoteParticipantsAudioLevel);
|
|
48
48
|
}))
|
|
49
49
|
.catch((error) => {
|
|
@@ -51,7 +51,8 @@ class Vapi extends events_1.default {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
handleRemoteParticipantsAudioLevel(e) {
|
|
54
|
-
const isSpeaking = Object.values(e.participantsAudioLevel).some((v) => v > 0);
|
|
54
|
+
const isSpeaking = Object.values(e.participantsAudioLevel).some((v) => v > 0.01);
|
|
55
|
+
console.log(isSpeaking);
|
|
55
56
|
if (isSpeaking === this.speaking)
|
|
56
57
|
return;
|
|
57
58
|
if (isSpeaking) {
|
package/package.json
CHANGED
package/vapi.ts
CHANGED
|
@@ -41,7 +41,7 @@ export default class Vapi extends EventEmitter {
|
|
|
41
41
|
this.call.iframe()?.style.setProperty("display", "none");
|
|
42
42
|
await this.call.join({ url });
|
|
43
43
|
|
|
44
|
-
this.call.startRemoteParticipantsAudioLevelObserver(
|
|
44
|
+
this.call.startRemoteParticipantsAudioLevelObserver();
|
|
45
45
|
this.call.on(
|
|
46
46
|
"remote-participants-audio-level",
|
|
47
47
|
this.handleRemoteParticipantsAudioLevel
|
|
@@ -56,8 +56,9 @@ export default class Vapi extends EventEmitter {
|
|
|
56
56
|
e: DailyEventObjectRemoteParticipantsAudioLevel
|
|
57
57
|
) {
|
|
58
58
|
const isSpeaking = Object.values(e.participantsAudioLevel).some(
|
|
59
|
-
(v) => v > 0
|
|
59
|
+
(v) => v > 0.01
|
|
60
60
|
);
|
|
61
|
+
console.log(isSpeaking);
|
|
61
62
|
if (isSpeaking === this.speaking) return;
|
|
62
63
|
|
|
63
64
|
if (isSpeaking) {
|