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

# XSpeechToTextUpdateHypothesisString

> XSpeechToTextUpdateHypothesisString

# XSpeechToTextUpdateHypothesisString

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

<a id="syntaxSection" />

## 语法

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

<a id="parametersSection" />

### 参数

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

由 [XSpeechToTextBeginHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring) 返回的假设 ID。

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

更新后的假设字符串。

<a id="retvalSection" />

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

<a id="remarksSection" />

## 备注

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

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

若要取消假设并将其从覆盖层中移除，请使用 [XSpeechToTextCancelHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring)。

若要最终确定假设，请使用 [XSpeechToTextFinalizeHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring)。

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

有关代码示例，请参阅 [XSpeechToTextBeginHypothesisString](/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring) 的[备注](/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring#remarksSection)部分。

<a id="requirementsSection" />

## 要求

**头文件：** XAccessibility.h

**库：** xgameruntime.lib

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

<a id="seealsoSection" />

## 另请参阅

[XAccessibility](/reference/system/xaccessibility/xaccessibility_members)


## Related topics

- [XSpeechToTextCancelHypothesisString](/zh-CN/reference/system/xaccessibility/functions/xspeechtotextcancelhypothesisstring.md)
- [XSpeechToTextFinalizeHypothesisString](/zh-CN/reference/system/xaccessibility/functions/xspeechtotextfinalizehypothesisstring.md)
- [XSpeechToTextBeginHypothesisString](/zh-CN/reference/system/xaccessibility/functions/xspeechtotextbeginhypothesisstring.md)
- [XAccessibility](/zh-CN/reference/system/xaccessibility/xaccessibility_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
