다음을 통해 공유


XSpeechToTextBeginHypothesisString

가설을 시작하고 해당 문자열을 텍스트 오버레이에 표시합니다.

구문

HRESULT XSpeechToTextBeginHypothesisString(  
         const char* speakerName,  
         const char* content,  
         XSpeechToTextType type,  
         uint32_t* hypothesisId  
)  

매개 변수

speakerName _In_z_
형식: char*

가설 문자열과 함께 표시할 화자의 이름입니다.

content _In_z_
형식: char*

최초 가설 문자열입니다.

type _In_
형식: XSpeechToTextType

가설 문자열의 원본 형식입니다.

hypothesisId _Out_
형식: uint32_t*

가설 ID입니다.

반환 값

형식: HRESULT

HRESULT 성공 또는 오류 코드입니다.

설명

가설이란 화자가 말하는 내용을 추측하는 것입니다. 일반적으로 화자가 말하는 중간에 음성 인식기에서 생성됩니다. 음성 텍스트 변환 오버레이 API는 게임 화면 위에 가설 문자열을 표시할 수 있습니다.

음성 텍스트 변환 오버레이 API는 입력 텍스트도 지원합니다. type 매개 변수는 가설 문자열의 원본을 식별합니다.

앱은 가설이 완료되거나 취소될 때까지 hypothesisId 값을 유지해야 합니다.

오버레이의 가설 문자열을 업데이트하려면 XSpeechToTextUpdateHypothesisString을 사용합니다.

가설을 취소하고 오버레이에서 제거하려면 XSpeechToTextCancelHypothesisString을 사용합니다.

가설을 완료하려면 XSpeechToTextFinalizeHypothesisString을 사용합니다.

일부 플랫폼에서는 앱에서 XSpeechToTextFinalizeHypothesisString을(를) 호출할 때까지 가설 문자열이 표시되지 않습니다. 가설이 취소되지 않는 한, 앱에서 항상 XSpeechToTextFinalizeHypothesisString을(를) 호출하여 문자열이 표시되도록 해야 합니다.

다음 코드 예제에서는 가설을 만들고 업데이트한 후 완료하는 앱을 보여 줍니다.

void RowanHypothesisSample() 
{ 
    UINT32 hypothesisId; 
    XSpeechToTextBeginHypothesisString("Rowan", "I am typing some text.", XSpeechToTextType::Text, &hypothesisId); 
 
    // Some time passes. 
 
    XSpeechToTextUpdateHypothesisString(hypothesisId, "I am still typing some text."); 
 
    // Some time passes. 
 
    XSpeechToTextFinalizeHypothesisString(hypothesisId, "I typed some text. I am done typing."); 
} 

다음 코드 예제에서는 가설을 만들고 업데이트한 후 취소하는 앱을 보여 줍니다.

void QuincyHypothesisSample() 
{ 
    UINT32 hypothesisId; 
    XSpeechToTextBeginHypothesisString("Quincy", "I am speaking some text.", XSpeechToTextType::Voice, &hypothesisId); 
 
    // Some time passes. 
 
    XSpeechToTextUpdateHypothesisString(hypothesisId, "I am still speaking some text."); 
 
    // Some time passes. 
 
    XSpeechToTextCancelHypothesisString(hypothesisId); 
} 

요구 사항

헤더: XAccessibility.h

라이브러리: xgameruntime.lib

지원되는 플랫폼: Windows, Xbox One 패밀리 콘솔 및 Xbox Series 콘솔

참고 항목

XAccessibility