# @aristech-org/tts-client 中文文档

规范地址：https://npmcn.com/package/%40aristech-org/tts-client/

版本：2\.1\.0
npm 元数据更新时间：2026-05-29T09:25:00.142Z
中文译文更新时间：2026-11-06T19:11:09.119Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aristech-org/tts-client
原文对照：https://npmcn.com/package/%40aristech-org/tts-client/?lang=original
项目主页：https://github.com/aristech-de/tts-clients#readme
源码仓库：https://github.com/aristech-de/tts-clients

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：152 kB，8 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：2 个
- 首次发布：2024-10-22T09:58:23.978Z
- 最新版本发布：2026-05-29T09:24:59.997Z
- 近 30 天下载量：4747（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：12（近 12 个月 1 个）

## 中文简介

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

## 安装

```sh
npm install @aristech-org/tts-client
```

也可以使用：`pnpm add @aristech-org/tts-client`、`yarn add @aristech-org/tts-client`、`bun add @aristech-org/tts-client`

## README

# 节点JS的 Aristech TTS 客户端

这是Aristech TTS-Server的NodeJS客户端执行.

## 安装

```bash
npm install @aristech-org/tts-client
```

## 使用量

```typescript
import { TtsClient } from '@aristech-org/tts-client'
import fs from 'fs'

const client = new TtsClient({ host: 'tts.example.com' })
const buffer = await client.synthesize({
  text: 'Hello, world!',
  options: { voiceId: 'anne_en_GB' },
})
fs.writeFileSync('path/to/output/file.wav', buffer)
```

报告有好几个例子 `examples` 目录 :

-   [file.ts 存档](https://npmcn.com/package/%40aristech-org/tts-client/examples/file.ts):与上例大致相同.
-   [流出中.ts](https://npmcn.com/package/%40aristech-org/tts-client/examples/streaming.ts): 演示如何将音频流到播放音频的袜子进程.
-   [声音.ts](https://npmcn.com/package/%40aristech-org/tts-client/examples/models.ts): 演示如何从服务器获取可用的声音.
-   [电话集.ts](https://npmcn.com/package/%40aristech-org/tts-client/examples/phoneset.ts):演示如何获得一个声音的电话集.
-   [转写.ts](https://npmcn.com/package/%40aristech-org/tts-client/examples/transcribe.ts): 演示如何获得一个声音如何发出一个给定的单词.

您可以直接使用 `tsx` 像这样:

1.  创建一个 `.env` 文档中 [节点](https://npmcn.com/package/%40aristech-org/tts-client/) 目录 :

```sh
HOST=tts.example.com
# The credentials are optional but probably required for most servers:
TOKEN=your-token
SECRET=your-secret

# The following are optional:
# ROOT_CERT=your-root-cert.pem # If the server uses a self-signed certificate
# SSL=true # Set to true if credentials are provided or if a ROOT_CERT is provided
# VOICE_ID=some-available-voice-id
```

2.  运行实例,例如:

```sh
npx tsx examples/streaming.ts
```

## 构建

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

```bash
npm run generate
```

要建立图书馆,运行:

```bash
npm run build
```

## 常见问题

### @aristech-org/tts-client 是什么？

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

### 如何安装 @aristech-org/tts-client？

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

### @aristech-org/tts-client 支持 TypeScript 吗？

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

### @aristech-org/tts-client 支持 ESM 还是 CommonJS？

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

### @aristech-org/tts-client 可以商用吗？

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

### @aristech-org/tts-client 的下载量有多少？

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

### @aristech-org/tts-client 还在维护吗？

最新版本 2\.1\.0 发布于 2026/05/29（5 个月前）；至今共发布 12 个版本，其中过去 12 个月发布了 1 个；首次发布于 2024/10/22。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

