XSpeechToTextUpdateHypothesisString

在文本覆盖中上传假设字符串。

语法

HRESULT XSpeechToTextUpdateHypothesisString(  
         uint32_t hypothesisId,  
         const char* content  
)  

参数

hypothesisId _In_
类型:uint32_t

XSpeechToTextBeginHypothesisString 返回的假设字符串的 ID。

content _In_z_
类型:char*

更新后的假设字符串。

返回值

类型:HRESULT

HRESULT 成功或错误代码。

备注

该函数原地更新假设字符串,无需将其移动到覆盖层的底部。

叠加只能显示有限数量的字符串。 当达到最大值时,较早的字符串则会过期。 若过期的字符串是尚未最终确定或取消的假设,则其 hypothesisId 值将会变为无效。 传递无效的 hypothesisId 值不会返回错误。

若要取消假设并从覆盖中删除,请使用 XSpeechToTextCancelHypothesisString

若要完成假设,请使用 XSpeechToTextFinalizeHypothesisString

在某些平台上,假设字符串直到应用程序调用 XSpeechToTextFinalizeHypothesisString 后才会显示。 除非取消该假设,否则应用必须始终调用 XSpeechToTextFinalizeHypothesisString,以确保显示该字符串。

有关代码示例,请参阅 XSpeechToTextBeginHypothesisString备注部分。

要求

头文件:XAccessibility.h

库:xgameruntime.lib

支持平台:Windows、Xbox One 系列主机和 Xbox Series 主机

另请参阅

XAccessibility