> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unreal-engine/blueprints-reference/speech-to-text.md).

# 语音转文字

### 从声波转文字

* **描述：** 将提供的音频转写为文本。

<figure><img src="/files/92e33d3505bea294e5552e47c9e693d2c6e10fdc" alt=""><figcaption></figcaption></figure>

**输入：**

* **声波：** 麦克风录制的输出，请查看教程/示例项目，了解如何将 Convai 语音采集组件与 API 一起使用。

**输出：**

#### ✅ \[成功时]

**响应：** 如果 API 成功，则包含音频文件的文本输出；否则可能包含 API 调用失败原因的信息。

#### ⛔ \[失败时]

*不返回任何内容，请查看日志以了解失败原因。*

### 从声波转文字

* **描述：** 将提供的音频文件转写为文本。

<figure><img src="/files/adfe397207f11121717ae1dd4a23faa394c324a2" alt=""><figcaption></figcaption></figure>

**输入：**

* **文件名：** 本地磁盘上录制音频文件的路径，该文件应为 .wav 格式。

**输出：**

#### ✅ \[成功时]

**响应：** 如果 API 成功，则包含音频文件的文本输出；否则可能包含 API 调用失败原因的信息。

#### ⛔ \[失败时]

*不返回任何内容，请查看日志以了解失败原因。*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unreal-engine/blueprints-reference/speech-to-text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
