auralwise_cli 1.0.1 → 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 +257 -0
- package/README_CN.md +270 -0
- package/bin/auralwise.js +1 -1
- package/lib/i18n.js +14 -4
- package/lib/utils.js +26 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# AuralWise CLI
|
|
2
|
+
|
|
3
|
+
[中文文档](./README_CN.md)
|
|
4
|
+
|
|
5
|
+
Command-line interface for [AuralWise](https://auralwise.cn) Speech Intelligence API.
|
|
6
|
+
|
|
7
|
+
One API call returns transcription, speaker diarization, speaker embeddings, word-level timestamps, and 521-class audio event detection — all at once.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Speech Transcription** — 99 languages, with a dedicated Chinese engine (`optimize_zh`) for faster speed and higher accuracy
|
|
12
|
+
- **Speaker Diarization** — Automatic speaker count detection, per-segment speaker labels
|
|
13
|
+
- **Speaker Embeddings** — 192-dim voice print vectors for cross-recording speaker matching
|
|
14
|
+
- **Timestamps** — Word-level (~10ms) or segment-level (~100ms) precision
|
|
15
|
+
- **Audio Event Detection** — 521 AudioSet sound event classes (applause, cough, music, keyboard, etc.)
|
|
16
|
+
- **VAD** — Voice Activity Detection segments
|
|
17
|
+
- **Batch Mode** — Half-price processing using off-peak GPU capacity, delivered within 24h
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g auralwise_cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Requires Node.js >= 18.
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Set your API key (get one at https://auralwise.cn)
|
|
31
|
+
export AURALWISE_API_KEY=asr_xxxxxxxxxxxxxxxxxxxx
|
|
32
|
+
|
|
33
|
+
# Transcribe from URL — waits for completion and prints results
|
|
34
|
+
auralwise transcribe https://example.com/meeting.mp3
|
|
35
|
+
|
|
36
|
+
# Transcribe a local file (auto base64 upload)
|
|
37
|
+
auralwise transcribe ./recording.wav
|
|
38
|
+
|
|
39
|
+
# Chinese optimization mode (faster, cheaper for Chinese audio)
|
|
40
|
+
auralwise transcribe ./meeting.mp3 --optimize-zh --language zh
|
|
41
|
+
|
|
42
|
+
# Submit without waiting
|
|
43
|
+
auralwise transcribe https://example.com/audio.mp3 --no-wait
|
|
44
|
+
|
|
45
|
+
# Get JSON output
|
|
46
|
+
auralwise transcribe ./audio.mp3 --json --output result.json
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
### `auralwise transcribe <source>`
|
|
52
|
+
|
|
53
|
+
Submit an audio file for processing. `<source>` can be an HTTP(S) URL or a local file path.
|
|
54
|
+
|
|
55
|
+
**Input modes:**
|
|
56
|
+
- **URL mode** — Pass an `https://...` URL; the GPU node downloads directly
|
|
57
|
+
- **File mode** — Pass a local file path; the CLI reads and uploads as base64
|
|
58
|
+
|
|
59
|
+
**Common options:**
|
|
60
|
+
|
|
61
|
+
| Option | Description |
|
|
62
|
+
|--------|-------------|
|
|
63
|
+
| `--language <lang>` | ASR language code (`zh`, `en`, `ja`, ...) or auto-detect if omitted |
|
|
64
|
+
| `--optimize-zh` | Use dedicated Chinese engine (faster, cheaper, segment-level timestamps) |
|
|
65
|
+
| `--no-asr` | Disable transcription |
|
|
66
|
+
| `--no-diarize` | Disable speaker diarization |
|
|
67
|
+
| `--no-events` | Disable audio event detection |
|
|
68
|
+
| `--hotwords <words>` | Boost recognition of specific words (comma-separated) |
|
|
69
|
+
| `--num-speakers <n>` | Set fixed number of speakers |
|
|
70
|
+
| `--max-speakers <n>` | Max speakers for auto-detection (default: 10) |
|
|
71
|
+
| `--batch` | Use batch mode (half-price, 24h delivery) |
|
|
72
|
+
| `--no-wait` | Return immediately after task creation |
|
|
73
|
+
| `--json` | Output result as JSON |
|
|
74
|
+
| `--output <file>` | Save result to file |
|
|
75
|
+
| `--callback-url <url>` | Webhook URL for completion notification |
|
|
76
|
+
|
|
77
|
+
**Advanced ASR options:**
|
|
78
|
+
|
|
79
|
+
| Option | Description |
|
|
80
|
+
|--------|-------------|
|
|
81
|
+
| `--beam-size <n>` | Beam search width (default: 5) |
|
|
82
|
+
| `--temperature <n>` | Decoding temperature (default: 0.0) |
|
|
83
|
+
| `--initial-prompt <text>` | Guide transcription style |
|
|
84
|
+
| `--vad-threshold <n>` | VAD sensitivity 0-1 (default: 0.35) |
|
|
85
|
+
| `--events-threshold <n>` | Audio event confidence threshold (default: 0.3) |
|
|
86
|
+
| `--events-classes <list>` | Only detect specific event classes |
|
|
87
|
+
|
|
88
|
+
### `auralwise tasks`
|
|
89
|
+
|
|
90
|
+
List your tasks with optional filtering.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
auralwise tasks # List all tasks
|
|
94
|
+
auralwise tasks --status done # Only completed tasks
|
|
95
|
+
auralwise tasks --page 2 --page-size 50 # Pagination
|
|
96
|
+
auralwise tasks --json # JSON output
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### `auralwise task <id>`
|
|
100
|
+
|
|
101
|
+
Get details of a specific task.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
auralwise task 550e8400-e29b-41d4-a716-446655440000
|
|
105
|
+
auralwise task 550e8400-e29b-41d4-a716-446655440000 --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `auralwise result <id>`
|
|
109
|
+
|
|
110
|
+
Retrieve the full result of a completed task.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
auralwise result <task-id> # Pretty-printed output
|
|
114
|
+
auralwise result <task-id> --json # JSON output
|
|
115
|
+
auralwise result <task-id> --output result.json # Save to file
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `auralwise delete <id>`
|
|
119
|
+
|
|
120
|
+
Delete a task and its associated files.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
auralwise delete <task-id> # With confirmation prompt
|
|
124
|
+
auralwise delete <task-id> --force # Skip confirmation
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `auralwise events`
|
|
128
|
+
|
|
129
|
+
Browse the 521 AudioSet sound event classes.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
auralwise events # List all 521 classes
|
|
133
|
+
auralwise events --search Cough # Search by name
|
|
134
|
+
auralwise events --category Music # Filter by category
|
|
135
|
+
auralwise events --json # JSON output
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Configuration
|
|
139
|
+
|
|
140
|
+
### API Key
|
|
141
|
+
|
|
142
|
+
Set your API key via `--api-key` flag or environment variable:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Environment variable (recommended)
|
|
146
|
+
export AURALWISE_API_KEY=asr_xxxxxxxxxxxxxxxxxxxx
|
|
147
|
+
|
|
148
|
+
# Or pass directly
|
|
149
|
+
auralwise --api-key asr_xxxx transcribe ./audio.mp3
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Base URL
|
|
153
|
+
|
|
154
|
+
Override the API endpoint (default: `https://auralwise.cn/api/v1`):
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
auralwise --base-url https://your-private-instance.com/api/v1 transcribe ./audio.mp3
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Language
|
|
161
|
+
|
|
162
|
+
The CLI supports English and Chinese interfaces:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
auralwise --locale zh --help # Chinese interface
|
|
166
|
+
auralwise --locale en transcribe --help # English interface (default)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Examples
|
|
170
|
+
|
|
171
|
+
### Meeting transcription with speaker diarization
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
auralwise transcribe ./meeting.mp3 \
|
|
175
|
+
--optimize-zh \
|
|
176
|
+
--language zh \
|
|
177
|
+
--max-speakers 5 \
|
|
178
|
+
--output meeting_result.json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Batch processing (half-price)
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
# Submit in batch mode — processed during off-peak hours, 50% discount
|
|
185
|
+
auralwise transcribe https://storage.example.com/archive.mp3 \
|
|
186
|
+
--batch \
|
|
187
|
+
--no-wait \
|
|
188
|
+
--callback-url https://your-server.com/webhook
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Audio event detection only
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
auralwise transcribe ./audio.mp3 \
|
|
195
|
+
--no-asr \
|
|
196
|
+
--no-diarize \
|
|
197
|
+
--events-classes "Cough,Music,Applause" \
|
|
198
|
+
--json
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Transcription only (no diarization, no events)
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
auralwise transcribe ./podcast.mp3 \
|
|
205
|
+
--no-diarize \
|
|
206
|
+
--no-events \
|
|
207
|
+
--hotwords "AuralWise,PGPU" \
|
|
208
|
+
--output transcript.json
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Output Format
|
|
212
|
+
|
|
213
|
+
### Pretty-printed (default)
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
Audio Duration: 5.3min
|
|
217
|
+
Language: zh (99%)
|
|
218
|
+
Speakers: 2
|
|
219
|
+
|
|
220
|
+
Transcription
|
|
221
|
+
|
|
222
|
+
[0:00.5 - 0:02.3] SPEAKER_0: This is the first sentence
|
|
223
|
+
[0:02.5 - 0:04.1] SPEAKER_1: And this is the reply
|
|
224
|
+
|
|
225
|
+
Audio Events
|
|
226
|
+
|
|
227
|
+
[0:45.0 - 0:45.9] Cough (87%)
|
|
228
|
+
[1:20.0 - 1:25.0] Music (92%)
|
|
229
|
+
|
|
230
|
+
Speaker Embeddings
|
|
231
|
+
|
|
232
|
+
SPEAKER_0: 25 segments, 192-dim vector
|
|
233
|
+
SPEAKER_1: 18 segments, 192-dim vector
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### JSON (`--json`)
|
|
237
|
+
|
|
238
|
+
Returns the full API response. See [API documentation](https://auralwise.cn/api-docs) for the complete schema.
|
|
239
|
+
|
|
240
|
+
## Pricing
|
|
241
|
+
|
|
242
|
+
| Capability | Standard | Batch (50% off) |
|
|
243
|
+
|-----------|----------|-----------------|
|
|
244
|
+
| Chinese transcription | ¥0.27/hr | ¥0.14/hr |
|
|
245
|
+
| General transcription (with word timestamps) | ¥1.20/hr | ¥0.60/hr |
|
|
246
|
+
| Speaker diarization (labels + embeddings) | +¥0.40/hr | +¥0.20/hr |
|
|
247
|
+
| Audio event detection (521 classes) | +¥0.10/hr | +¥0.05/hr |
|
|
248
|
+
|
|
249
|
+
**Example: 100 hours of Chinese meetings (full features) = ¥39 in batch mode.**
|
|
250
|
+
|
|
251
|
+
## API Documentation
|
|
252
|
+
|
|
253
|
+
Full API reference: https://auralwise.cn/api-docs
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
MIT
|
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.
|
|
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/lib/i18n.js
CHANGED
|
@@ -98,14 +98,19 @@ const messages = {
|
|
|
98
98
|
category: 'Category',
|
|
99
99
|
noEventsFound: 'No matching events found.',
|
|
100
100
|
|
|
101
|
+
// Result display - additional
|
|
102
|
+
vadSegments: 'VAD Segments',
|
|
103
|
+
diarizeSegments: 'Diarize Segments',
|
|
104
|
+
langProb: 'Language Probability',
|
|
105
|
+
|
|
101
106
|
// Command descriptions
|
|
102
|
-
descMain: 'CLI
|
|
107
|
+
descMain: 'AuralWise Speech Intelligence API CLI\n\n Transcription, speaker diarization, speaker embeddings,\n word-level timestamps, and 521-class audio event detection\n — all in one API call.',
|
|
103
108
|
descTranscribe: 'Submit an audio transcription task (URL or local file)',
|
|
104
109
|
descTasks: 'List tasks',
|
|
105
110
|
descTask: 'Get task details',
|
|
106
111
|
descResult: 'Get task result',
|
|
107
112
|
descDelete: 'Delete a task',
|
|
108
|
-
descEvents: 'List
|
|
113
|
+
descEvents: 'List all 521 AudioSet sound event classes',
|
|
109
114
|
argSource: 'Audio URL or local file path',
|
|
110
115
|
argTaskId: 'Task ID',
|
|
111
116
|
},
|
|
@@ -208,14 +213,19 @@ const messages = {
|
|
|
208
213
|
category: '类别',
|
|
209
214
|
noEventsFound: '未找到匹配的事件。',
|
|
210
215
|
|
|
216
|
+
// Result display - additional
|
|
217
|
+
vadSegments: 'VAD 语音段',
|
|
218
|
+
diarizeSegments: '说话人分离段',
|
|
219
|
+
langProb: '语言置信度',
|
|
220
|
+
|
|
211
221
|
// Command descriptions
|
|
212
|
-
descMain: 'AuralWise 语音智能 API
|
|
222
|
+
descMain: 'AuralWise 语音智能 API 命令行工具\n\n 转写、说话人分离、声纹向量、词级时间戳、521 类声音事件检测\n —— 一次调用,全部返回。',
|
|
213
223
|
descTranscribe: '提交音频转写任务(URL 或本地文件)',
|
|
214
224
|
descTasks: '列出任务',
|
|
215
225
|
descTask: '查看任务详情',
|
|
216
226
|
descResult: '获取任务结果',
|
|
217
227
|
descDelete: '删除任务',
|
|
218
|
-
descEvents: '
|
|
228
|
+
descEvents: '列出全部 521 类 AudioSet 声音事件',
|
|
219
229
|
argSource: '音频 URL 或本地文件路径',
|
|
220
230
|
argTaskId: '任务 ID',
|
|
221
231
|
},
|
package/lib/utils.js
CHANGED
|
@@ -85,6 +85,32 @@ export function printResult(result) {
|
|
|
85
85
|
console.log(` ${chalk.cyan(spk.speaker_id)}: ${spk.segment_count} ${t('segments')}, ${spk.embedding.length}${t('dimVector')}`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
|
|
89
|
+
if (result.vad_segments && result.vad_segments.length > 0) {
|
|
90
|
+
console.log();
|
|
91
|
+
console.log(chalk.bold.underline(`${t('vadSegments')} (${result.vad_segments.length})`));
|
|
92
|
+
console.log();
|
|
93
|
+
for (const seg of result.vad_segments.slice(0, 20)) {
|
|
94
|
+
const dur = (seg.end - seg.start).toFixed(1);
|
|
95
|
+
console.log(` [${formatTime(seg.start)} - ${formatTime(seg.end)}] ${chalk.dim(`${dur}s`)}`);
|
|
96
|
+
}
|
|
97
|
+
if (result.vad_segments.length > 20) {
|
|
98
|
+
console.log(chalk.dim(` ... +${result.vad_segments.length - 20} more`));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (result.diarize_segments && result.diarize_segments.length > 0) {
|
|
103
|
+
console.log();
|
|
104
|
+
console.log(chalk.bold.underline(`${t('diarizeSegments')} (${result.diarize_segments.length})`));
|
|
105
|
+
console.log();
|
|
106
|
+
for (const seg of result.diarize_segments.slice(0, 20)) {
|
|
107
|
+
const dur = (seg.end - seg.start).toFixed(1);
|
|
108
|
+
console.log(` [${formatTime(seg.start)} - ${formatTime(seg.end)}] ${chalk.cyan(seg.speaker)} ${chalk.dim(`${dur}s`)}`);
|
|
109
|
+
}
|
|
110
|
+
if (result.diarize_segments.length > 20) {
|
|
111
|
+
console.log(chalk.dim(` ... +${result.diarize_segments.length - 20} more`));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
88
114
|
}
|
|
89
115
|
|
|
90
116
|
export function printTaskDetail(task) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auralwise_cli",
|
|
3
|
-
"version": "1.0.
|
|
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",
|