@aristech-org/stt-client

中文文档
2.5.0发布于 2026/05/04MITTypeScriptES Module近 30 天下载 5428

Aristech 语音对文本 API 的节点客户端库

中文使用文档
文档目录4 节
  1. 安装
  2. 使用量
  3. API 密钥
  4. 构建

节点JS的 Aristech STT - 客户端

这是Aristech STT-Server的节点JS客户端执行.

安装

npm install @aristech-org/stt-client

使用量

import { SttClient } from '@aristech-org/stt-client'

const client = new SttClient({
  apiKey: process.env['ARISTECH_STT_API_KEY'], // This is the default and can be omitted
})
const results = await client.recognizeFile('path/to/audio/file.wav')
console.log(results.map(r => r.chunks[0].alternatives[0].text).join('\n'))

报告有好几个例子 实例 目录 :

  • 识别.ts:与上例大致相同.
  • 流出中.ts:演示如何在接收临时结果的同时将音频流到服务器.
  • 型号.ts: 演示如何从服务器获取可用的模型.
  • nlp 函数数: 演示如何列出已配置的 NLP- Servers 和对应函数 .
  • nlp 处理器:通过使用STT-Server作为代理来演示如何在文本上进行NLP处理.
  • 账户.ts: 演示如何从服务器获取账户信息.

运行示例时使用 npx tsx。例如:

npx tsx examples/streaming.ts

API 密钥

如果您没有获得 API 密钥而是一个符号, 秘密和主机, 您可以和我们一起生成 API 密钥 API 密钥生成器。 。 。 .

或者您仍然可以手动提供连接选项 .
import { SttClient } from '@aristech-org/stt-client'

const client = new SttClient({
  host: 'stt.example.com:443',
  auth: {
    token: 'your-token',
    secret: 'your-secret'
  }
})

构建

要重建原始文件中生成的打字符文件, 运行 :

npm run generate

要建立图书馆,运行:

npm run build

版本与发布记录

@aristech-org/stt-client 共发布 18 个版本,首次发布于 2024/10/21;过去 12 个月发布了 2 个版本。

版本发布日期距今
2.5.0latest2026/05/046 个月前
2.4.02025/11/2611 个月前
2.3.02025/10/141.1 年前
2.2.22025/09/301.1 年前
2.2.12025/08/251.2 年前
2.2.02025/05/151.5 年前

关于 @aristech-org/stt-client 的常见问题

@aristech-org/stt-client 是什么?

Aristech 语音对文本 API 的节点客户端库

如何安装 @aristech-org/stt-client?

在项目目录运行 npm install @aristech-org/stt-client,或使用 pnpm add / yarn add / bun add。

@aristech-org/stt-client 支持 TypeScript 吗?

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

@aristech-org/stt-client 支持 ESM 还是 CommonJS?

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

@aristech-org/stt-client 可以商用吗?

@aristech-org/stt-client 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aristech-org/stt-client 的下载量有多少?

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

@aristech-org/stt-client 还在维护吗?

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