perf: avoid silk encoding blocking the main event loop (#527)

This commit is contained in:
pk5ls20 authored and GitHub committed 2024-11-15 20:39:18 +08:00
1 parent 74b4d9bf49
commit e44595334a
4 files changed
+44 -16

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import { encode } from "silk-wasm";
export interface EncodeArgs {
input: ArrayBufferView | ArrayBuffer
sampleRate: number
}
export default async ({ input, sampleRate }: EncodeArgs) => {
return await encode(input, sampleRate);
};