auralwise_cli 1.0.2 → 1.0.3

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.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # AuralWise CLI
2
2
 
3
+ [中文文档](./README_CN.md)
4
+
3
5
  Command-line interface for [AuralWise](https://auralwise.cn) Speech Intelligence API.
4
6
 
5
7
  One API call returns transcription, speaker diarization, speaker embeddings, word-level timestamps, and 521-class audio event detection — all at once.
package/README_CN.md ADDED
@@ -0,0 +1,270 @@
1
+ # AuralWise CLI
2
+
3
+ [English](./README.md)
4
+
5
+ [AuralWise](https://auralwise.cn) 语音智能 API 的命令行工具。
6
+
7
+ 一次调用,同时返回转写、说话人分离、声纹向量、词级时间戳和 521 类声音事件 —— 花接近基础转写的钱,拿到完整可用的结构化结果。
8
+
9
+ ## 核心能力
10
+
11
+ - **语音转写** — 支持 99 种语言,中文场景使用专用引擎(`optimize_zh`),速度更快、准确率更高
12
+ - **说话人分离** — 自动检测说话人数量,为每段文本标注说话人标签
13
+ - **说话人声纹向量** — 192 维声纹向量,可用于跨录音比对同一说话人
14
+ - **精准时间戳** — 词级(~10ms)或段级(~100ms)精度
15
+ - **声音事件检测** — 521 类 AudioSet 声音事件(掌声、咳嗽、音乐、键盘声等)
16
+ - **语音活动检测** — VAD 语音段识别
17
+ - **批量模式** — 使用闲时 GPU 算力,价格直接五折,24 小时内交付
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ npm install -g auralwise_cli
23
+ ```
24
+
25
+ 需要 Node.js >= 18。
26
+
27
+ ## 快速上手
28
+
29
+ ```bash
30
+ # 设置 API Key(在 https://auralwise.cn 获取)
31
+ export AURALWISE_API_KEY=asr_xxxxxxxxxxxxxxxxxxxx
32
+
33
+ # URL 模式转写 — 等待完成并输出结果
34
+ auralwise transcribe https://example.com/meeting.mp3
35
+
36
+ # 本地文件转写(自动 base64 上传)
37
+ auralwise transcribe ./recording.wav
38
+
39
+ # 中文精简模式(更快、更便宜)
40
+ auralwise transcribe ./meeting.mp3 --optimize-zh --language zh
41
+
42
+ # 提交后立即返回,不等待完成
43
+ auralwise transcribe https://example.com/audio.mp3 --no-wait
44
+
45
+ # JSON 输出并保存到文件
46
+ auralwise transcribe ./audio.mp3 --json --output result.json
47
+
48
+ # 使用中文界面
49
+ auralwise --locale zh transcribe --help
50
+ ```
51
+
52
+ ## 命令列表
53
+
54
+ ### `auralwise transcribe <source>`
55
+
56
+ 提交音频进行处理。`<source>` 可以是 HTTP(S) URL 或本地文件路径。
57
+
58
+ **输入方式:**
59
+ - **URL 模式** — 传入 `https://...` URL,GPU 节点直接下载
60
+ - **文件模式** — 传入本地文件路径,CLI 读取文件并以 base64 上传
61
+
62
+ **常用选项:**
63
+
64
+ | 选项 | 说明 |
65
+ |------|------|
66
+ | `--language <lang>` | ASR 识别语言(`zh`、`en`、`ja` 等),不指定则自动检测 |
67
+ | `--optimize-zh` | 使用中文专用引擎(更快、更便宜,段级时间戳) |
68
+ | `--no-asr` | 禁用语音转写 |
69
+ | `--no-diarize` | 禁用说话人分离 |
70
+ | `--no-events` | 禁用声音事件检测 |
71
+ | `--hotwords <words>` | 热词列表(逗号分隔),提升专有名词识别率 |
72
+ | `--num-speakers <n>` | 指定固定说话人数 |
73
+ | `--max-speakers <n>` | 自动检测时最大说话人数(默认 10) |
74
+ | `--batch` | 批量模式(五折价格,24 小时内完成) |
75
+ | `--no-wait` | 提交后立即返回,不轮询等待 |
76
+ | `--json` | 以 JSON 格式输出 |
77
+ | `--output <file>` | 将结果保存到文件 |
78
+ | `--callback-url <url>` | Webhook 回调 URL,任务完成后通知 |
79
+
80
+ **高级 ASR 选项:**
81
+
82
+ | 选项 | 说明 |
83
+ |------|------|
84
+ | `--beam-size <n>` | Beam Search 宽度(默认 5) |
85
+ | `--temperature <n>` | 解码温度(默认 0.0) |
86
+ | `--initial-prompt <text>` | 初始提示文本,引导转写风格 |
87
+ | `--vad-threshold <n>` | VAD 语音检测阈值 0-1(默认 0.35) |
88
+ | `--events-threshold <n>` | 声音事件置信度阈值(默认 0.3) |
89
+ | `--events-classes <list>` | 仅检测指定的事件类别 |
90
+
91
+ ### `auralwise tasks`
92
+
93
+ 查看任务列表,支持按状态过滤和分页。
94
+
95
+ ```bash
96
+ auralwise tasks # 列出所有任务
97
+ auralwise tasks --status done # 仅已完成的任务
98
+ auralwise tasks --page 2 --page-size 50 # 分页
99
+ auralwise tasks --json # JSON 输出
100
+ ```
101
+
102
+ ### `auralwise task <id>`
103
+
104
+ 查看单个任务的详细信息。
105
+
106
+ ```bash
107
+ auralwise task 550e8400-e29b-41d4-a716-446655440000
108
+ auralwise task 550e8400-e29b-41d4-a716-446655440000 --json
109
+ ```
110
+
111
+ ### `auralwise result <id>`
112
+
113
+ 获取已完成任务的完整转写结果。
114
+
115
+ ```bash
116
+ auralwise result <task-id> # 格式化输出
117
+ auralwise result <task-id> --json # JSON 输出
118
+ auralwise result <task-id> --output result.json # 保存到文件
119
+ ```
120
+
121
+ ### `auralwise delete <id>`
122
+
123
+ 删除任务及其关联的音频文件和结果。
124
+
125
+ ```bash
126
+ auralwise delete <task-id> # 删除前确认
127
+ auralwise delete <task-id> --force # 跳过确认
128
+ ```
129
+
130
+ ### `auralwise events`
131
+
132
+ 浏览 521 类 AudioSet 声音事件。
133
+
134
+ ```bash
135
+ auralwise events # 列出全部 521 类
136
+ auralwise events --search 咳嗽 # 按名称搜索
137
+ auralwise events --category Music # 按类别过滤
138
+ auralwise events --json # JSON 输出
139
+ ```
140
+
141
+ ## 配置
142
+
143
+ ### API Key
144
+
145
+ 通过 `--api-key` 参数或环境变量设置:
146
+
147
+ ```bash
148
+ # 环境变量(推荐)
149
+ export AURALWISE_API_KEY=asr_xxxxxxxxxxxxxxxxxxxx
150
+
151
+ # 或直接传入
152
+ auralwise --api-key asr_xxxx transcribe ./audio.mp3
153
+ ```
154
+
155
+ ### 自定义 API 地址
156
+
157
+ 私有化部署时可修改 API 地址(默认 `https://auralwise.cn/api/v1`):
158
+
159
+ ```bash
160
+ auralwise --base-url https://your-private-instance.com/api/v1 transcribe ./audio.mp3
161
+ ```
162
+
163
+ ### 界面语言
164
+
165
+ CLI 支持中英文界面切换:
166
+
167
+ ```bash
168
+ auralwise --locale zh --help # 中文界面
169
+ auralwise --locale en transcribe --help # 英文界面(默认)
170
+ ```
171
+
172
+ ## 使用示例
173
+
174
+ ### 会议录音转写 + 说话人分离
175
+
176
+ ```bash
177
+ auralwise transcribe ./meeting.mp3 \
178
+ --optimize-zh \
179
+ --language zh \
180
+ --max-speakers 5 \
181
+ --output meeting_result.json
182
+ ```
183
+
184
+ ### 批量处理(五折价格)
185
+
186
+ ```bash
187
+ # 批量模式 — 利用闲时算力处理,价格直接五折
188
+ auralwise transcribe https://storage.example.com/archive.mp3 \
189
+ --batch \
190
+ --no-wait \
191
+ --callback-url https://your-server.com/webhook
192
+ ```
193
+
194
+ ### 仅声音事件检测
195
+
196
+ ```bash
197
+ auralwise transcribe ./audio.mp3 \
198
+ --no-asr \
199
+ --no-diarize \
200
+ --events-classes "Cough,Music,Applause" \
201
+ --json
202
+ ```
203
+
204
+ ### 仅转写(不需要说话人分离和事件检测)
205
+
206
+ ```bash
207
+ auralwise transcribe ./podcast.mp3 \
208
+ --no-diarize \
209
+ --no-events \
210
+ --hotwords "AuralWise,PGPU" \
211
+ --output transcript.json
212
+ ```
213
+
214
+ ## 输出格式
215
+
216
+ ### 格式化输出(默认)
217
+
218
+ ```
219
+ Audio Duration: 5.3min
220
+ Language: zh (99%)
221
+ Speakers: 2
222
+
223
+ Transcription
224
+
225
+ [0:00.5 - 0:02.3] SPEAKER_0: 好的,我们先来看第一个议题
226
+ [0:02.5 - 0:04.1] SPEAKER_1: 没问题,请继续
227
+
228
+ Audio Events
229
+
230
+ [0:45.0 - 0:45.9] Cough (87%)
231
+ [1:20.0 - 1:25.0] Music (92%)
232
+
233
+ Speaker Embeddings
234
+
235
+ SPEAKER_0: 25 segments, 192-dim vector
236
+ SPEAKER_1: 18 segments, 192-dim vector
237
+ ```
238
+
239
+ ### JSON 输出(`--json`)
240
+
241
+ 返回完整的 API 响应,详见 [API 文档](https://auralwise.cn/api-docs)。
242
+
243
+ ## 定价
244
+
245
+ | 能力 | 标准价格 | 批量模式(五折) |
246
+ |------|---------|----------------|
247
+ | 中文转写 | ¥0.27/小时 | ¥0.14/小时 |
248
+ | 通用转写(含词级时间戳) | ¥1.20/小时 | ¥0.60/小时 |
249
+ | 说话人分离(标签 + 声纹向量) | +¥0.40/小时 | +¥0.20/小时 |
250
+ | 声音事件检测(521 类) | +¥0.10/小时 | +¥0.05/小时 |
251
+
252
+ **示例:100 小时中文会议录音(全功能)= 批量模式仅需 ¥39。**
253
+
254
+ ## 适用场景
255
+
256
+ - **会议纪要与知识库** — 自动识别每位发言人,生成结构化会议记录
257
+ - **客服录音质检** — 多角色对话分析,配合声音事件检测辅助质检
258
+ - **访谈 / 播客整理** — 批量转写,按说话人切分段落,快速生成字幕
259
+ - **法务 / 合规留档** — 支持私有化部署,数据不出域,方便检索和证据提取
260
+ - **课程 / 教育内容** — 课堂录音批量处理,生成带时间戳的字幕
261
+ - **影视 / 字幕制作** — 词级时间戳直接生成时间轴字幕
262
+ - **历史档案数字化** — 批量模式低成本处理历史录音
263
+
264
+ ## API 文档
265
+
266
+ 完整 API 参考:https://auralwise.cn/api-docs
267
+
268
+ ## 许可证
269
+
270
+ MIT
package/bin/auralwise.js CHANGED
@@ -20,7 +20,7 @@ const program = new Command();
20
20
  program
21
21
  .name('auralwise')
22
22
  .description(t('descMain'))
23
- .version('1.0.2')
23
+ .version('1.0.3')
24
24
  .option('--api-key <key>', t('optApiKey'))
25
25
  .option('--base-url <url>', t('optBaseUrl'), 'https://auralwise.cn/api/v1')
26
26
  .option('--locale <locale>', t('optLocale'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auralwise_cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "CLI for AuralWise audio intelligence API - transcription, speaker diarization, audio event detection",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "files": [
10
10
  "bin/",
11
- "lib/"
11
+ "lib/",
12
+ "README_CN.md"
12
13
  ],
13
14
  "scripts": {
14
15
  "test": "vitest run",