> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XSpeechToTextUpdateHypothesisString

> XSpeechToTextUpdateHypothesisString

# XSpeechToTextUpdateHypothesisString

在文本覆盖层中更新假设字符串。

## 语法

```cpp theme={null}
HRESULT XSpeechToTextUpdateHypothesisString(  
         uint32_t hypothesisId,  
         const char* content  
)  
```

### 参数

*hypothesisId*   \_In\_\
类型：uint32\_t

由 [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md) 返回的假设 ID。

*content*   \_In\_z\_\
类型：char\*

更新后的假设字符串。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

此函数原地更新假设字符串，而不会将其移动到覆盖层的底部。

覆盖层只能显示有限数量的字符串。达到最大数量时，较旧的字符串将过期。如果过期的字符串是一个尚未最终确定或取消的假设，则其 *hypothesisId* 值将变为无效。传入无效的 *hypothesisId* 值不会返回错误。

若要取消假设并将其从覆盖层中移除，请使用 [XSpeechToTextCancelHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)。

若要最终确定假设，请使用 [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)。

在某些平台上，假设字符串在应用调用 `XSpeechToTextFinalizeHypothesisString` 之前不会显示。除非取消假设，否则你的应用必须始终调用 `XSpeechToTextFinalizeHypothesisString` 以确保该字符串得以显示。

有关代码示例，请参阅 [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md) 的[备注](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md#remarksSection)部分。

## 要求

**头文件：** XAccessibility.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[XAccessibility](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/xaccessibility_members.md)


## Related topics

- [XSpeechToTextCancelHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XSpeechToTextBeginHypothesisString](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XAccessibility（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xaccessibility/xaccessibility_members.md)
- [在 Unity 项目中使用 GDK API 的 C# 包装器](https://docs.xbox.com/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
