> ## 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.

# PartyLocalChatControl::SetTextToSpeechProfile

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

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

## Syntax

```cpp theme={null}
PartyError SetTextToSpeechProfile(  
    PartySynthesizeTextToSpeechType type,  
    PartyString profileIdentifier,  
    void* asyncIdentifier  
)  
```

### Parameters

**`type`**   [PartySynthesizeTextToSpeechType](/services/playfab/multiplayer/networking/reference/enums/partysynthesizetexttospeechtype)

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

**`profileIdentifier`**   [PartyString](/services/playfab/multiplayer/networking/reference/typedefs)

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()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

The profile provided is used for all subsequent calls to [SynthesizeTextToSpeech()](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_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. <br /><br /> This method accepts a profile identifier to indicate the profile selection so that titles may either pass in the result of [PartyTextToSpeechProfile::GetIdentifier()](/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/methods/partytexttospeechprofile_getidentifier) or provide a profile identifier cached from a previous Party library session.   <br /><br /> Multiple SetTextToSpeechProfile() operations can be initiated, and they are asynchronously queued. Each operation is processed and completed in order.   <br /><br /> This is an asynchronous operation; a [PartySetTextToSpeechProfileCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partysettexttospeechprofilecompletedstatechange) is provided via [PartyManager::StartProcessingStateChanges()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_startprocessingstatechanges) on completion.   <br /><br /> Text-to-speech synthesis functionality internally uses available region and latency measurement estimates to optimize service usage. If the [PartyOption::RegionUpdateConfiguration](/services/playfab/multiplayer/networking/reference/enums/partyoption) option was used to configure an update mode of [PartyRegionUpdateMode::Deferred](/services/playfab/multiplayer/networking/reference/enums/partyregionupdatemode), 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](/services/playfab/multiplayer/networking/reference/structs/partyregionschangedstatechange) is provided prior to this call's [PartySetTextToSpeechProfileCompletedStateChange](/services/playfab/multiplayer/networking/reference/structs/partysettexttospeechprofilecompletedstatechange) completion.

## Requirements

**Header:** Party.h

## See also

[PartyLocalChatControl](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/partylocalchatcontrol)\
[PartyLocalChatControl::GetTextToSpeechProfile](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_gettexttospeechprofile)


## Related topics

- [PartyLocalChatControl::SynthesizeTextToSpeech](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_synthesizetexttospeech.md)
- [PartyLocalChatControl::PopulateAvailableTextToSpeechProfiles](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_populateavailabletexttospeechprofiles.md)
- [PartyLocalChatControl::GetTextToSpeechProfile](/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_gettexttospeechprofile.md)
- [PartyTextToSpeechProfile](/services/playfab/multiplayer/networking/reference/classes/PartyTextToSpeechProfile/partytexttospeechprofile.md)
- [PartySynthesizeTextToSpeechType](/services/playfab/multiplayer/networking/reference/enums/partysynthesizetexttospeechtype.md)
