@desert-ant-labs/who

中文文档
4.3.0发布于 2026/11/06SEE LICENSE IN LICENSE.mdTypeScriptES Module近 30 天下载 7100

On-device speaker diarization for JavaScript: who spoke when, as per-speaker turns with timestamps. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.

原始使用文档

@desert-ant-labs/who

On-device speaker diarization for JavaScript that runs in the browser and in Node: who spoke when, as per-speaker turns with timestamps, in one pass over the audio. Speakers are numbered in the order they first speak, overlapping speech is marked for both, and recordings of any length are read in five-minute sections joined by voice. Audio stays local.

Two entries share one Who API:

  • @desert-ant-labs/who (default): a WebAssembly pipeline with LiteRT.js inference, for the browser, on the CPU. Safe to import during server-side rendering; Who.load() runs inference only in a browser or Web Worker.
  • @desert-ant-labs/who/native: a prebuilt native core, Core ML on macOS and LiteRT on Linux, for server-side inference in Node. Import it from server-only code.
npm i @desert-ant-labs/who @litertjs/core   # browser
npm i @desert-ant-labs/who                  # Node, prebuilt native core
import { Who } from "@desert-ant-labs/who";

const who = await Who.load();                   // downloads the 32 MB model on first use
const result = await who.diarize(file);         // a File or Blob, the bytes of an audio file, or samples

result.speakerCount;                            // 3
for (const turn of result.turns) {
  turn.speaker;                                 // 0, 1, 2: numbered in order of first appearance
  turn.start;                                   // 12.4, seconds from the start
  turn.end;                                     // 15.9
}
result.keepingSpeakers({ minimumShare: 0.05 }); // without the speakers under 5% of the recording
who.dispose();

diarize takes the bytes of an audio file (File, Blob, ArrayBuffer, Uint8Array), mono Float32Array samples at 16 kHz, or { samples, sampleRate } at any rate. In the browser a file is decoded with Web Audio, so any format the browser plays works. In Node the portable decoder reads WAV; decode other formats first:

import { Who } from "@desert-ant-labs/who/native";
import fs from "node:fs/promises";

const who = await Who.load();
const result = await who.diarize(await fs.readFile("call.wav"));

JSON.stringify(result) stores a diarization and Diarization.fromJSON restores it. Create one Who and reuse it; dispose() releases the model. The browser build runs the graphs on the CPU; pass accelerator: "auto" to Who.load to try WebGPU.

The full guide is in the Who docs.

License

Desert Ant Labs Source-Available License. Free for most apps, and a commercial license is required at scale. Full terms are at the link. Licensing: [email protected].

Third-party notices for the SDK: THIRD_PARTY_NOTICES.md.

Third-party notices for the weights: THIRD_PARTY_NOTICES.md.

版本与发布记录

@desert-ant-labs/who 共发布 6 个版本,首次发布于 2026/10/27;过去 12 个月发布了 6 个版本。

版本发布日期距今
4.3.0latest2026/11/066 天前
4.2.32026/10/3112 天前
4.2.22026/10/3112 天前
4.2.12026/10/2815 天前
4.2.02026/10/2716 天前
0.0.0-stage2026/10/2716 天前

关于 @desert-ant-labs/who 的常见问题

@desert-ant-labs/who 是什么?

On-device speaker diarization for JavaScript: who spoke when, as per-speaker turns with timestamps. Runs in the browser (WebAssembly + LiteRT.js) and server-side in Node (native), from one import.

如何安装 @desert-ant-labs/who?

在项目目录运行 npm install @desert-ant-labs/who,或使用 pnpm add / yarn add / bun add。

@desert-ant-labs/who 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@desert-ant-labs/who 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@desert-ant-labs/who 可以商用吗?

@desert-ant-labs/who 使用 SEE LICENSE IN LICENSE.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@desert-ant-labs/who 的下载量有多少?

根据 npm 官方下载统计,@desert-ant-labs/who 在 2026/10/12 – 2026/11/10 这 30 天内被下载 7,100 次,日均约 237 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@desert-ant-labs/who 还在维护吗?

最新版本 4.3.0 发布于 2026/11/06(6 天前);至今共发布 6 个版本,其中过去 12 个月发布了 6 个;首次发布于 2026/10/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。