Editar

Compartir vía


PartyLocalChatControl::SetTextToSpeechProfile

Configures the profile to use for a specified type of text-to-speech operation.

Syntax

PartyError SetTextToSpeechProfile(  
    PartySynthesizeTextToSpeechType type,  
    PartyString profileIdentifier,  
    void* asyncIdentifier  
)  

Parameters

type   PartySynthesizeTextToSpeechType

The type of text-to-speech operations for which the specified profile should be used.

profileIdentifier   PartyString

The identifier of the profile that text-to-speech operations of the specified type should use.

asyncIdentifier   void*
optional

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

Return value

PartyError

c_partyErrorSuccess if the asynchronous operation to set the text-to-speech profile began, or an error code otherwise. If this method fails, no related state changes will be generated. The human-readable form of the error code can be retrieved via PartyManager::GetErrorMessage().

Remarks

The profile provided is used for all subsequent calls to SynthesizeTextToSpeech() that specify the same value for type. No profile is configured until SetTextToSpeechProfile() is called at least once. Thus, this method must be called at least once before any calls to SynthesizeTextToSpeech() succeed.

This method accepts a profile identifier to indicate the profile selection so that titles may either pass in the result of PartyTextToSpeechProfile::GetIdentifier() or provide a profile identifier cached from a previous Party library session.

Multiple SetTextToSpeechProfile() operations can be initiated, and they are asynchronously queued. Each operation is processed and completed in order.

This is an asynchronous operation; a PartySetTextToSpeechProfileCompletedStateChange is provided via PartyManager::StartProcessingStateChanges() on completion.

Text-to-speech synthesis functionality internally uses available region and latency measurement estimates to optimize service usage. If the PartyOption::RegionUpdateConfiguration option was used to configure an update mode of PartyRegionUpdateMode::Deferred, then retrieving the set of available regions and measuring connection quality to them may not have started yet, or the last update may have exceeded the configured refresh interval age. If the local device isn't currently connecting or connected to any networks, SetTextToSpeechProfile() ensures any deferred region update has started and the associated PartyRegionsChangedStateChange is provided prior to this call's PartySetTextToSpeechProfileCompletedStateChange completion.

Requirements

Header: Party.h

See also

PartyLocalChatControl
PartyLocalChatControl::GetTextToSpeechProfile