PartyVoiceChatTranscriptionReceivedStateChange

Information specific to the VoiceChatTranscriptionReceived type of state change.

Syntax

struct PartyVoiceChatTranscriptionReceivedStateChange : PartyStateChange {  
    PartyStateChangeResult result;  
    PartyError errorDetail;  
    PartyChatControl* senderChatControl;  
    uint32_t receiverChatControlCount;  
    PartyLocalChatControlArray receiverChatControls;  
    PartyAudioSourceType sourceType;  
    PartyString languageCode;  
    PartyString transcription;  
    PartyVoiceChatTranscriptionPhraseType type;  
    uint32_t translationCount;  
    PartyTranslation* translations;  
}  

Members

result   PartyStateChangeResult

Indicates that the transcription operation Succeeded or provides the reason that it failed.

On success, the transcription field is a string of non-zero length. On failure, the string is empty. Failure indicates that a transcription operation was attempted for the speaker but could not be completed. If transcription is enabled at the request of the user associated with the chat control, and the transcription messages are shown via UI, it is recommended that failures also be indicated to the user in order to provide feedback as to whether transcriptions are pending or have failed.

errorDetail   PartyError

A diagnostic value providing additional troubleshooting information regarding any potential error condition.

The human-readable form of this error detail can be retrieved via PartyManager::GetErrorMessage().

senderChatControl   PartyChatControl*

The chat control object that originated the transcription message.

receiverChatControlCount   uint32_t

The number of local receiver chat controls to which the transcription is addressed.

receiverChatControls   PartyLocalChatControlArray
array of size receiverChatControlCount

The local receiver chat controls to which the transcription is addressed.

sourceType   PartyAudioSourceType

The type of audio source this transcription represents.

The audio source type can optionally be used for game scenarios in which transcriptions from different source types should be treated differently. For instance, different iconography may be shown depending on whether the transcription is associated with microphone or text-to-speech audio.

languageCode   PartyString

The language code of the transcription.

The language code is always provided when the result field indicates success. Otherwise, the language code is an empty string.

The language code is in BCP 47 format, such as en-US for English (United States). Supported language codes are enumerated in Language support.

transcription   PartyString

The transcribed voice chat text.

The string may be up to c_maxChatTextMessageLength characters long, not including the null terminator. The string is always empty when the result field indicates failures.

type   PartyVoiceChatTranscriptionPhraseType

Indicates the phrase type of the text provided in the transcription field.

The type is always PartyVoiceChatTranscriptionPhraseType::Final when the result field indicates failure.

translationCount   uint32_t

The number of translations associated with the transcribed voice chat text.

Translations are provided if PartyVoiceChatTranscriptionOptions::TranslateToLocalLanguage has previously been specified via PartyLocalChatControl::SetTranscriptionOptions() on a chat control local to this device. There may be more than one translation if multiple local chat controls have enabled translation and the local chat controls have specified different languages via PartyLocalDevice::CreateChatControl(). In that case, the app can compare the languageCode field of each PartyTranslation in translations against the language code, obtained via PartyLocalChatControl::GetLanguage(), for each local chat control in receiverChatControls to determine the target local chat control for each translation.

translations   PartyTranslation*
array of size translationCount

An array containing the translations of the voice chat transcription string.

Translations are provided if PartyVoiceChatTranscriptionOptions::TranslateToLocalLanguage has previously been specified via PartyLocalChatControl::SetTranscriptionOptions() on a chat control local to this device. There may be more than one translation if multiple local chat controls have enabled translation and the local chat controls have specified different languages via PartyLocalDevice::CreateChatControl(). In that case, the app can compare the languageCode field of each PartyTranslation in translations against the language code, obtained via PartyLocalChatControl::GetLanguage(), for each local chat control in receiverChatControls to determine the target local chat control for each translation.

A translation corresponding to the language for each chat control in receiverChatControls that has enabled translation is provided, even if the speaking chat control's language is the same as the local chat control's language. In such a case, the transcription and translation strings are identical.

Requirements

Header: Party.h

See also

Party members
PartyLocalDevice::CreateChatControl
PartyLocalChatControl::SetTranscriptionOptions