# 语音转写与错误事件

> 全部文档的索引见 [llms.txt](https://ark.volcengine.com/llms.txt)；在任一文档页面地址后追加 `.md` 可获取该页的 Markdown 版本。

语音转写流式事件及错误事件。

## 语音转写

### response.transcription_part.added

> 当转写内容新增部分时触发的事件。

**item_id** `string` | 输出项 ID

`response.transcription_part.added.item_id`

所属输出项的唯一 ID。

**output_index** `integer` | 输出项索引

`response.transcription_part.added.output_index`

所属输出项的列表索引。

**part** `object` | 转写部分

`response.transcription_part.added.part`

所添加的转写部分。

**type** `string` | 类型

`response.transcription_part.added.part.type`

转写片段类型。

取值固定为 `transcription_text`。

**chunks** `object[]` | 音频小段

`response.transcription_part.added.part.chunks`

当前片段对应的音频小段列表。

**end_time** `integer` | 结束时间

`response.transcription_part.added.part.chunks.end_time`

片段结束时间（毫秒）

**start_time** `integer` | 开始时间

`response.transcription_part.added.part.chunks.start_time`

片段开始时间（毫秒）

**text** `string` | 文字内容

`response.transcription_part.added.part.chunks.text`

当前片段对应的文字内容。

**text** `string` | 转写文本

`response.transcription_part.added.part.text`

当前片段的转写文本。

**sequence_number** `integer` | 序列号

`response.transcription_part.added.sequence_number`

事件的序列号。

**transcription_index** `integer` | 转写索引

`response.transcription_part.added.transcription_index`

所属转写片段的索引。

**type** `string` | 事件类型

`response.transcription_part.added.type`

事件的类型，总是 `response.transcription_part.added`

### response.transcription_part.done

> 当转写部分完成时触发的事件。

**item_id** `string` | 输出项 ID

`response.transcription_part.done.item_id`

所属输出项的唯一 ID。

**output_index** `integer` | 输出项索引

`response.transcription_part.done.output_index`

所属输出项的列表索引。

**part** `object` | 转写部分

`response.transcription_part.done.part`

已完成的转写部分。

**type** `string` | 类型

`response.transcription_part.done.part.type`

转写片段类型。

取值固定为 `transcription_text`。

**chunks** `object[]` | 音频小段

`response.transcription_part.done.part.chunks`

当前片段对应的音频小段列表。

**end_time** `integer` | 结束时间

`response.transcription_part.done.part.chunks.end_time`

片段结束时间（毫秒）

**start_time** `integer` | 开始时间

`response.transcription_part.done.part.chunks.start_time`

片段开始时间（毫秒）

**text** `string` | 文字内容

`response.transcription_part.done.part.chunks.text`

当前片段对应的文字内容。

**text** `string` | 转写文本

`response.transcription_part.done.part.text`

当前片段的转写文本。

**sequence_number** `integer` | 序列号

`response.transcription_part.done.sequence_number`

事件的序列号。

**transcription_index** `integer` | 转写索引

`response.transcription_part.done.transcription_index`

所属转写片段的索引。

**type** `string` | 事件类型

`response.transcription_part.done.type`

事件的类型，总是 `response.transcription_part.done`

### response.transcription_text.delta

> 当转写文本片段新增时触发的事件。

**end_time** `integer` | 结束时间

`response.transcription_text.delta.end_time`

本段转写片段的结束时间，单位为毫秒。

**item_id** `string` | 输出项 ID

`response.transcription_text.delta.item_id`

所属输出项的唯一 ID。

**output_index** `integer` | 输出项索引

`response.transcription_text.delta.output_index`

所属输出项的列表索引。

**sequence_number** `integer` | 序列号

`response.transcription_text.delta.sequence_number`

事件的序列号。

**start_time** `integer` | 起始时间

`response.transcription_text.delta.start_time`

本段转写片段的起始时间，单位为毫秒。

**transcription_index** `integer` | 转写索引

`response.transcription_text.delta.transcription_index`

所属转写片段的索引。

**type** `string` | 事件类型

`response.transcription_text.delta.type`

事件的类型，总是 `response.transcription_text.delta`

**delta** `string` | 转写增量

`response.transcription_text.delta.delta`

新增的转写文本片段。

### response.transcription_text.done

> 当转写文本内容完成时触发的事件。

**chunks** `object[]` | 音频片段

`response.transcription_text.done.chunks`

与本段完整转写关联的音频片段。

**end_time** `integer` | 结束时间

`response.transcription_text.done.chunks.end_time`

片段结束时间（毫秒）

**start_time** `integer` | 开始时间

`response.transcription_text.done.chunks.start_time`

片段开始时间（毫秒）

**text** `string` | 文字内容

`response.transcription_text.done.chunks.text`

当前片段对应的文字内容。

**end_time** `integer` | 结束时间

`response.transcription_text.done.end_time`

本段转写片段的结束时间，单位为毫秒。

**item_id** `string` | 输出项 ID

`response.transcription_text.done.item_id`

所属输出项的唯一 ID。

**output_index** `integer` | 输出项索引

`response.transcription_text.done.output_index`

所属输出项的列表索引。

**sequence_number** `integer` | 序列号

`response.transcription_text.done.sequence_number`

事件的序列号。

**start_time** `integer` | 起始时间

`response.transcription_text.done.start_time`

本段转写片段的起始时间，单位为毫秒。

**transcription_index** `integer` | 转写索引

`response.transcription_text.done.transcription_index`

所属转写片段的索引。

**type** `string` | 事件类型

`response.transcription_text.done.type`

事件的类型，总是 `response.transcription_text.done`

**text** `string` | 转写文本

`response.transcription_text.done.text`

完整的转写文本内容。

## 错误事件

### error

> 发生错误时触发。

**message** `string` | 错误原因

`error.message`

**sequence_number** `integer` | 序列号

`error.sequence_number`

事件的序列号。

**type** `string` | 事件类型

`error.type`

事件的类型，总是 `error`

**code** `string` | 错误码

`error.code`

**param** `string` | 错误参数

`error.param`

导致错误的参数名。
