@layercode/js-sdk 1.0.12 → 1.0.13
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/types/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ interface LayercodeClientOptions {
|
|
|
10
10
|
authorizeSessionEndpoint: string;
|
|
11
11
|
/** Metadata to send with webhooks */
|
|
12
12
|
metadata?: Record<string, any>;
|
|
13
|
+
/** Enable/disable voice activity detector (VAD) which improves turn taking */
|
|
14
|
+
vadEnabled?: boolean;
|
|
13
15
|
/** Callback when connection is established */
|
|
14
16
|
onConnect?: ({ sessionId }: {
|
|
15
17
|
sessionId: string | null;
|
|
@@ -35,9 +37,11 @@ declare class LayercodeClient {
|
|
|
35
37
|
private options;
|
|
36
38
|
private wavRecorder;
|
|
37
39
|
private wavPlayer;
|
|
40
|
+
private vad;
|
|
38
41
|
private ws;
|
|
39
42
|
private AMPLITUDE_MONITORING_SAMPLE_RATE;
|
|
40
43
|
private pushToTalkActive;
|
|
44
|
+
private vadPausedPlayer;
|
|
41
45
|
_websocketUrl: string;
|
|
42
46
|
status: string;
|
|
43
47
|
userAudioAmplitude: number;
|
|
@@ -90,5 +94,10 @@ declare class LayercodeClient {
|
|
|
90
94
|
*/
|
|
91
95
|
connect(): Promise<void>;
|
|
92
96
|
disconnect(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets the microphone MediaStream used by this client
|
|
99
|
+
* @returns {MediaStream|null} The microphone stream or null if not initialized
|
|
100
|
+
*/
|
|
101
|
+
getStream(): MediaStream | null;
|
|
93
102
|
}
|
|
94
103
|
export default LayercodeClient;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Layercode",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"name": "@layercode/js-sdk",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.13",
|
|
6
6
|
"description": "Layercode JavaScript SDK for browser usage",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/layercode-js-sdk.esm.js",
|
|
@@ -42,5 +42,9 @@
|
|
|
42
42
|
"rollup": "^4.0.0",
|
|
43
43
|
"tslib": "^2.5.0",
|
|
44
44
|
"typescript": "^5.8.2"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@ricky0123/vad-web": "^0.0.24",
|
|
48
|
+
"onnxruntime-web": "^1.21.1"
|
|
45
49
|
}
|
|
46
50
|
}
|