Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class VoiceSelectionParams.
Description of which voice to use for speech synthesis.
Generated from protobuf message google.cloud.dialogflow.v2.VoiceSelectionParams
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Optional. The name of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and ssml_gender.
↳ ssml_gender
int
Optional. The preferred gender of the voice. If not set, the service will choose a voice based on the other parameters such as language_code and name. Note that this is only a preference, not requirement. If a voice of the appropriate gender is not available, the synthesizer should substitute a voice with a different gender rather than failing the request.
getName
Optional. The name of the voice. If not set, the service will choose a
voice based on the other parameters such as language_code and
ssml_gender.
Returns
Type
Description
string
setName
Optional. The name of the voice. If not set, the service will choose a
voice based on the other parameters such as language_code and
ssml_gender.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getSsmlGender
Optional. The preferred gender of the voice. If not set, the service will
choose a voice based on the other parameters such as language_code and
name. Note that
this is only a preference, not requirement. If a voice of the appropriate
gender is not available, the synthesizer should substitute a voice with a
different gender rather than failing the request.
Returns
Type
Description
int
setSsmlGender
Optional. The preferred gender of the voice. If not set, the service will
choose a voice based on the other parameters such as language_code and
name. Note that
this is only a preference, not requirement. If a voice of the appropriate
gender is not available, the synthesizer should substitute a voice with a
different gender rather than failing the request.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Dialogflow V2 Client - Class VoiceSelectionParams (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.VoiceSelectionParams)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.VoiceSelectionParams)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.VoiceSelectionParams)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.VoiceSelectionParams)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.VoiceSelectionParams)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.VoiceSelectionParams)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.VoiceSelectionParams)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.VoiceSelectionParams)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.VoiceSelectionParams)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.VoiceSelectionParams)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.VoiceSelectionParams)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.VoiceSelectionParams)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.VoiceSelectionParams)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.VoiceSelectionParams)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.VoiceSelectionParams)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.VoiceSelectionParams)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.VoiceSelectionParams)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.VoiceSelectionParams)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.VoiceSelectionParams)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.VoiceSelectionParams)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.VoiceSelectionParams) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class VoiceSelectionParams.\n\nDescription of which voice to use for speech synthesis.\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.VoiceSelectionParams`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nOptional. The name of the voice. If not set, the service will choose a\nvoice based on the other parameters such as language_code and\n[ssml_gender](/php/docs/reference/cloud-dialogflow/latest/V2.VoiceSelectionParams#_Google_Cloud_Dialogflow_V2_VoiceSelectionParams__getSsmlGender__).\n\n### setName\n\nOptional. The name of the voice. If not set, the service will choose a\nvoice based on the other parameters such as language_code and\n[ssml_gender](/php/docs/reference/cloud-dialogflow/latest/V2.VoiceSelectionParams#_Google_Cloud_Dialogflow_V2_VoiceSelectionParams__getSsmlGender__).\n\n### getSsmlGender\n\nOptional. The preferred gender of the voice. If not set, the service will\nchoose a voice based on the other parameters such as language_code and\n[name](/php/docs/reference/cloud-dialogflow/latest/V2.VoiceSelectionParams#_Google_Cloud_Dialogflow_V2_VoiceSelectionParams__getName__). Note that\nthis is only a preference, not requirement. If a voice of the appropriate\ngender is not available, the synthesizer should substitute a voice with a\ndifferent gender rather than failing the request.\n\n### setSsmlGender\n\nOptional. The preferred gender of the voice. If not set, the service will\nchoose a voice based on the other parameters such as language_code and\n[name](/php/docs/reference/cloud-dialogflow/latest/V2.VoiceSelectionParams#_Google_Cloud_Dialogflow_V2_VoiceSelectionParams__getName__). Note that\nthis is only a preference, not requirement. If a voice of the appropriate\ngender is not available, the synthesizer should substitute a voice with a\ndifferent gender rather than failing the request."]]