@eka-care/ekascribe-ts-sdk 1.4.2 → 1.4.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.
|
@@ -125,9 +125,6 @@ class VadWebClient {
|
|
|
125
125
|
this.frame_size = FRAME_SIZE;
|
|
126
126
|
this.speech_pad_frames = PRE_SPEECH_PAD_FRAMES;
|
|
127
127
|
this.micVad = {};
|
|
128
|
-
// instantiate MicVad
|
|
129
|
-
// TODO: initialise this in start recording
|
|
130
|
-
// this.initVad();
|
|
131
128
|
}
|
|
132
129
|
/**
|
|
133
130
|
* Check for continuous silence and trigger periodic warnings
|
|
@@ -9,13 +9,11 @@ export default async function fetchWrapper(url, options = {}, timeoutMs = API_TI
|
|
|
9
9
|
controller.abort();
|
|
10
10
|
}, timeoutMs);
|
|
11
11
|
const newHeaders = new Headers(options.headers);
|
|
12
|
-
console.log('GET_CLIENT_ID()', GET_CLIENT_ID());
|
|
13
12
|
if (!newHeaders.get('client-id')) {
|
|
14
13
|
newHeaders.set('client-id', GET_CLIENT_ID());
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
newHeaders.set('Authorization', GET_AUTH_TOKEN());
|
|
15
|
+
if (!newHeaders.get('auth') && GET_AUTH_TOKEN()) {
|
|
16
|
+
newHeaders.set('auth', GET_AUTH_TOKEN());
|
|
19
17
|
}
|
|
20
18
|
const response = await fetch(url, {
|
|
21
19
|
...options,
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare class EkaScribe {
|
|
|
7
7
|
private audioBufferInstance;
|
|
8
8
|
private constructor();
|
|
9
9
|
static getInstance({ access_token, env, clientId, }: {
|
|
10
|
-
access_token
|
|
10
|
+
access_token?: string;
|
|
11
11
|
env?: 'PROD' | 'DEV';
|
|
12
12
|
clientId?: string;
|
|
13
13
|
}): EkaScribe;
|
|
@@ -53,7 +53,7 @@ declare class EkaScribe {
|
|
|
53
53
|
}): void;
|
|
54
54
|
}
|
|
55
55
|
export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
|
|
56
|
-
access_token
|
|
56
|
+
access_token?: string;
|
|
57
57
|
env?: "PROD" | "DEV";
|
|
58
58
|
clientId?: string;
|
|
59
59
|
}) => EkaScribe;
|
package/dist/index.js
CHANGED
|
@@ -50,14 +50,13 @@ class EkaScribe {
|
|
|
50
50
|
}
|
|
51
51
|
// Static method to get the singleton instance with optional initialization
|
|
52
52
|
static getInstance({ access_token, env, clientId, }) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
53
|
+
if (access_token) {
|
|
54
|
+
setEnv({
|
|
55
|
+
auth_token: access_token,
|
|
56
|
+
env,
|
|
57
|
+
clientId,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
61
60
|
if (!EkaScribe.instance) {
|
|
62
61
|
EkaScribe.instance = new EkaScribe();
|
|
63
62
|
console.log('EkaScribe.instance', EkaScribe.instance);
|
|
@@ -14,7 +14,7 @@ const startVoiceRecording = async () => {
|
|
|
14
14
|
message: 'Microphone access is required to start recording. Please recheck access.',
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
await vadInstance?.initVad();
|
|
18
18
|
const micVad = vadInstance?.getMicVad();
|
|
19
19
|
const isVadLoading = vadInstance?.isVadLoading();
|
|
20
20
|
if (isVadLoading || !micVad || Object.keys(micVad).length === 0) {
|