@napuketto/media 0.2.3 → 0.4.0

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.
@@ -0,0 +1 @@
1
+ export {}
@@ -0,0 +1,8 @@
1
+ import { parentPort, workerData } from "node:worker_threads";
2
+ import { decode, encode } from "silk-wasm";
3
+ // src/silk-worker.mts
4
+ const job = workerData;
5
+ const result = await (job.mode === "encode" ? encode : decode)(job.data, job.sampleRate);
6
+ const buffer = result.data.buffer;
7
+ parentPort?.postMessage(result, buffer instanceof ArrayBuffer ? [buffer] : []);
8
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@napuketto/media",
4
- "version": "0.2.3",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "description": "Media utilities for NapukettoQQ",
7
7
  "keywords": [