@vapi-ai/web 2.2.2 → 2.2.4
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/api.ts +13798 -10177
- package/dist/api.d.ts +9350 -6964
- package/dist/api.js +925 -358
- package/dist/vapi.d.ts +1 -0
- package/dist/vapi.js +20 -0
- package/package.json +3 -3
- package/vapi.ts +26 -0
package/dist/vapi.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
57
57
|
isMuted(): boolean;
|
|
58
58
|
say(message: string, endCallAfterSpoken?: boolean): void;
|
|
59
59
|
setInputDevicesAsync(options: Parameters<DailyCall['setInputDevicesAsync']>[0]): void;
|
|
60
|
+
increaseMicLevel(gain: number): Promise<void>;
|
|
60
61
|
setOutputDeviceAsync(options: Parameters<DailyCall['setOutputDeviceAsync']>[0]): void;
|
|
61
62
|
getDailyCallObject(): DailyCall | null;
|
|
62
63
|
startScreenSharing(displayMediaOptions?: DisplayMediaStreamOptions, screenVideoSendSettings?: DailyVideoSendSettings): void;
|
package/dist/vapi.js
CHANGED
|
@@ -313,6 +313,26 @@ class Vapi extends VapiEventEmitter {
|
|
|
313
313
|
setInputDevicesAsync(options) {
|
|
314
314
|
this.call?.setInputDevicesAsync(options);
|
|
315
315
|
}
|
|
316
|
+
async increaseMicLevel(gain) {
|
|
317
|
+
if (!this.call) {
|
|
318
|
+
throw new Error('Call object is not available.');
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
322
|
+
const audioContext = new AudioContext();
|
|
323
|
+
const source = audioContext.createMediaStreamSource(stream);
|
|
324
|
+
const gainNode = audioContext.createGain();
|
|
325
|
+
gainNode.gain.value = gain;
|
|
326
|
+
source.connect(gainNode);
|
|
327
|
+
const destination = audioContext.createMediaStreamDestination();
|
|
328
|
+
gainNode.connect(destination);
|
|
329
|
+
const [boostedTrack] = destination.stream.getAudioTracks();
|
|
330
|
+
await this.call.setInputDevicesAsync({ audioSource: boostedTrack });
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
console.error("Error adjusting microphone level:", error);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
316
336
|
setOutputDeviceAsync(options) {
|
|
317
337
|
this.call?.setOutputDeviceAsync(options);
|
|
318
338
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/web",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/vapi.js",
|
|
6
6
|
"types": "dist/vapi.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test": "jest",
|
|
9
9
|
"build": "tsc && tsc --declaration",
|
|
10
10
|
"start": "npm run generate-api && npm run build && node dist/vapi.js",
|
|
11
|
-
"generate-api": "npx swagger-typescript-api -p https://api.vapi.ai/api-json -o . -n api.ts",
|
|
11
|
+
"generate-api": "npx swagger-typescript-api -p https://api.vapi.ai/api-extended-json -o . -n api.ts",
|
|
12
12
|
"update": "./update.sh"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://github.com/VapiAI/web#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@daily-co/daily-js": "^0.
|
|
25
|
+
"@daily-co/daily-js": "^0.75.2",
|
|
26
26
|
"events": "^3.3.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
package/vapi.ts
CHANGED
|
@@ -469,6 +469,32 @@ export default class Vapi extends VapiEventEmitter {
|
|
|
469
469
|
this.call?.setInputDevicesAsync(options);
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
+
public async increaseMicLevel(gain: number) {
|
|
473
|
+
if (!this.call) {
|
|
474
|
+
throw new Error('Call object is not available.');
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
try {
|
|
478
|
+
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
|
|
479
|
+
const audioContext = new AudioContext();
|
|
480
|
+
|
|
481
|
+
const source = audioContext.createMediaStreamSource(stream);
|
|
482
|
+
|
|
483
|
+
const gainNode = audioContext.createGain();
|
|
484
|
+
gainNode.gain.value = gain;
|
|
485
|
+
|
|
486
|
+
source.connect(gainNode);
|
|
487
|
+
|
|
488
|
+
const destination = audioContext.createMediaStreamDestination();
|
|
489
|
+
gainNode.connect(destination);
|
|
490
|
+
|
|
491
|
+
const [boostedTrack] = destination.stream.getAudioTracks();
|
|
492
|
+
await this.call.setInputDevicesAsync({ audioSource: boostedTrack });
|
|
493
|
+
} catch (error) {
|
|
494
|
+
console.error("Error adjusting microphone level:", error);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
472
498
|
public setOutputDeviceAsync(
|
|
473
499
|
options: Parameters<DailyCall['setOutputDeviceAsync']>[0],
|
|
474
500
|
) {
|