Skip to content

Commit

Permalink
add sdk to wroker
Browse files Browse the repository at this point in the history
  • Loading branch information
laves committed Nov 3, 2023
1 parent 6432ada commit 9ca028a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions binding/web/src/octopus_worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export class OctopusWorker {
this._sampleRate = sampleRate;
}

public static setSdk(sdk: string): void {
OctopusWorker._sdk = sdk;
}

/**
* Get Octopus engine version.
*/
Expand Down Expand Up @@ -85,6 +81,10 @@ export class OctopusWorker {
}
}

public static setSdk(sdk: string): void {
OctopusWorker._sdk = sdk;
}

/**
* Creates a worker instance of the Picovoice Octopus Speech-to-Text engine.
* Behind the scenes, it requires the WebAssembly code to load and initialize before
Expand Down Expand Up @@ -158,6 +158,7 @@ export class OctopusWorker {
options: options,
wasm: this._wasm,
wasmSimd: this._wasmSimd,
sdk: this._sdk,
});

return returnPromise;
Expand Down
1 change: 1 addition & 0 deletions binding/web/src/octopus_worker_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const initRequest = async (request: OctopusWorkerInitRequest): Promise<any> => {
try {
Octopus.setWasm(request.wasm);
Octopus.setWasmSimd(request.wasmSimd);
Octopus.setSdk(request.sdk);
octopus = await Octopus._init(
request.accessKey,
request.modelPath,
Expand Down
1 change: 1 addition & 0 deletions binding/web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type OctopusWorkerInitRequest = {
options: OctopusOptions;
wasm: string;
wasmSimd: string;
sdk: string;
};

export type OctopusWorkerIndexRequest = {
Expand Down

0 comments on commit 9ca028a

Please sign in to comment.