Generated from protobuf messagegoogle.cloud.dialogflow.v2.SpeechToTextConfig
Namespace
Google \ Cloud \ Dialogflow \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ speech_model_variant
int
The speech model used in speech to text.SPEECH_MODEL_VARIANT_UNSPECIFIED,USE_BEST_AVAILABLEwill be treated asUSE_ENHANCED. It can be overridden inAnalyzeContentRequestandStreamingAnalyzeContentRequestrequest. If enhanced model variant is specified and an enhanced version of the specified model for the language does not exist, then it would emit an error.
↳ model
string
Which Speech model to select. Select the model best suited to your domain to get best results. If a model is not explicitly specified, then Dialogflow auto-selects a model based on other parameters in the SpeechToTextConfig and Agent settings. If enhanced speech model is enabled for the agent and an enhanced version of the specified model for the language does not exist, then the speech is recognized using the standard version of the specified model. Refer toCloud Speech API documentationfor more details. If you specify a model, the following models typically have the best performance: - phone_call (best for Agent Assist and telephony) - latest_short (best for Dialogflow non-telephony) - command_and_search Leave this field unspecified to useAgent Speech settingsfor model selection.
↳ phrase_sets
array
List of names of Cloud Speech phrase sets that are used for transcription. For phrase set limitations, please refer toCloud Speech API quotas and limits.
The language of the supplied audio. Dialogflow does not do translations. SeeLanguage Supportfor a list of the currently supported language codes. Note that queries in the same session do not necessarily need to specify the same language.
↳ enable_word_info
bool
Iftrue, Dialogflow returnsSpeechWordInfoinStreamingRecognitionResultwith information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information.
↳ use_timeout_based_endpointing
bool
Use timeout based endpointing, interpreting endpointer sensitivity as seconds of timeout value.
getSpeechModelVariant
The speech model used in speech to text.
SPEECH_MODEL_VARIANT_UNSPECIFIED,USE_BEST_AVAILABLEwill be treated asUSE_ENHANCED. It can be overridden inAnalyzeContentRequestandStreamingAnalyzeContentRequestrequest. If enhanced model variant is specified and an enhanced version of
the specified model for the language does not exist, then it would emit an
error.
Returns
Type
Description
int
setSpeechModelVariant
The speech model used in speech to text.
SPEECH_MODEL_VARIANT_UNSPECIFIED,USE_BEST_AVAILABLEwill be treated asUSE_ENHANCED. It can be overridden inAnalyzeContentRequestandStreamingAnalyzeContentRequestrequest. If enhanced model variant is specified and an enhanced version of
the specified model for the language does not exist, then it would emit an
error.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getModel
Which Speech model to select. Select the
model best suited to your domain to get best results. If a model is not
explicitly specified, then Dialogflow auto-selects a model based on other
parameters in the SpeechToTextConfig and Agent settings.
If enhanced speech model is enabled for the agent and an enhanced
version of the specified model for the language does not exist, then the
speech is recognized using the standard version of the specified model.
Refer toCloud Speech API
documentationfor more details.
If you specify a model, the following models typically have the best
performance:
phone_call (best for Agent Assist and telephony)
latest_short (best for Dialogflow non-telephony)
command_and_search
Leave this field unspecified to useAgent Speech
settingsfor model selection.
Returns
Type
Description
string
setModel
Which Speech model to select. Select the
model best suited to your domain to get best results. If a model is not
explicitly specified, then Dialogflow auto-selects a model based on other
parameters in the SpeechToTextConfig and Agent settings.
If enhanced speech model is enabled for the agent and an enhanced
version of the specified model for the language does not exist, then the
speech is recognized using the standard version of the specified model.
Refer toCloud Speech API
documentationfor more details.
If you specify a model, the following models typically have the best
performance:
phone_call (best for Agent Assist and telephony)
latest_short (best for Dialogflow non-telephony)
command_and_search
Leave this field unspecified to useAgent Speech
settingsfor model selection.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPhraseSets
List of names of Cloud Speech phrase sets that are used for transcription.
The language of the supplied audio. Dialogflow does not do
translations. SeeLanguage
Supportfor a list of the currently supported language codes. Note that queries in
the same session do not necessarily need to specify the same language.
Returns
Type
Description
string
setLanguageCode
The language of the supplied audio. Dialogflow does not do
translations. SeeLanguage
Supportfor a list of the currently supported language codes. Note that queries in
the same session do not necessarily need to specify the same language.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getEnableWordInfo
Iftrue, Dialogflow returnsSpeechWordInfoinStreamingRecognitionResultwith information about the recognized speech words, e.g. start and end time
offsets. If false or unspecified, Speech doesn't return any word-level
information.
Returns
Type
Description
bool
setEnableWordInfo
Iftrue, Dialogflow returnsSpeechWordInfoinStreamingRecognitionResultwith information about the recognized speech words, e.g. start and end time
offsets. If false or unspecified, Speech doesn't return any word-level
information.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getUseTimeoutBasedEndpointing
Use timeout based endpointing, interpreting endpointer sensitivity as
seconds of timeout value.
Returns
Type
Description
bool
setUseTimeoutBasedEndpointing
Use timeout based endpointing, interpreting endpointer sensitivity as
seconds of timeout value.
[[["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 SpeechToTextConfig (2.1.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.1.2 (latest)](/php/docs/reference/cloud-dialogflow/latest/V2.SpeechToTextConfig)\n- [2.1.1](/php/docs/reference/cloud-dialogflow/2.1.1/V2.SpeechToTextConfig)\n- [2.0.1](/php/docs/reference/cloud-dialogflow/2.0.1/V2.SpeechToTextConfig)\n- [1.17.2](/php/docs/reference/cloud-dialogflow/1.17.2/V2.SpeechToTextConfig)\n- [1.16.0](/php/docs/reference/cloud-dialogflow/1.16.0/V2.SpeechToTextConfig)\n- [1.15.1](/php/docs/reference/cloud-dialogflow/1.15.1/V2.SpeechToTextConfig)\n- [1.14.0](/php/docs/reference/cloud-dialogflow/1.14.0/V2.SpeechToTextConfig)\n- [1.13.0](/php/docs/reference/cloud-dialogflow/1.13.0/V2.SpeechToTextConfig)\n- [1.12.3](/php/docs/reference/cloud-dialogflow/1.12.3/V2.SpeechToTextConfig)\n- [1.11.0](/php/docs/reference/cloud-dialogflow/1.11.0/V2.SpeechToTextConfig)\n- [1.10.2](/php/docs/reference/cloud-dialogflow/1.10.2/V2.SpeechToTextConfig)\n- [1.9.0](/php/docs/reference/cloud-dialogflow/1.9.0/V2.SpeechToTextConfig)\n- [1.8.0](/php/docs/reference/cloud-dialogflow/1.8.0/V2.SpeechToTextConfig)\n- [1.7.2](/php/docs/reference/cloud-dialogflow/1.7.2/V2.SpeechToTextConfig)\n- [1.6.0](/php/docs/reference/cloud-dialogflow/1.6.0/V2.SpeechToTextConfig)\n- [1.5.0](/php/docs/reference/cloud-dialogflow/1.5.0/V2.SpeechToTextConfig)\n- [1.4.0](/php/docs/reference/cloud-dialogflow/1.4.0/V2.SpeechToTextConfig)\n- [1.3.2](/php/docs/reference/cloud-dialogflow/1.3.2/V2.SpeechToTextConfig)\n- [1.2.0](/php/docs/reference/cloud-dialogflow/1.2.0/V2.SpeechToTextConfig)\n- [1.1.1](/php/docs/reference/cloud-dialogflow/1.1.1/V2.SpeechToTextConfig)\n- [1.0.1](/php/docs/reference/cloud-dialogflow/1.0.1/V2.SpeechToTextConfig) \nReference documentation and code samples for the Google Cloud Dialogflow V2 Client class SpeechToTextConfig.\n\nConfigures speech transcription for\n[ConversationProfile](/php/docs/reference/cloud-dialogflow/latest/V2.ConversationProfile).\n\nGenerated from protobuf message `google.cloud.dialogflow.v2.SpeechToTextConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dialogflow \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSpeechModelVariant\n\nThe speech model used in speech to text.\n\n`SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as\n`USE_ENHANCED`. It can be overridden in\n[AnalyzeContentRequest](/php/docs/reference/cloud-dialogflow/latest/V2.AnalyzeContentRequest)\nand\n[StreamingAnalyzeContentRequest](/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest)\nrequest. If enhanced model variant is specified and an enhanced version of\nthe specified model for the language does not exist, then it would emit an\nerror.\n\n### setSpeechModelVariant\n\nThe speech model used in speech to text.\n\n`SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as\n`USE_ENHANCED`. It can be overridden in\n[AnalyzeContentRequest](/php/docs/reference/cloud-dialogflow/latest/V2.AnalyzeContentRequest)\nand\n[StreamingAnalyzeContentRequest](/php/docs/reference/cloud-dialogflow/latest/V2.StreamingAnalyzeContentRequest)\nrequest. If enhanced model variant is specified and an enhanced version of\nthe specified model for the language does not exist, then it would emit an\nerror.\n\n### getModel\n\nWhich Speech model to select. Select the\nmodel best suited to your domain to get best results. If a model is not\nexplicitly specified, then Dialogflow auto-selects a model based on other\nparameters in the SpeechToTextConfig and Agent settings.\n\nIf enhanced speech model is enabled for the agent and an enhanced\nversion of the specified model for the language does not exist, then the\nspeech is recognized using the standard version of the specified model.\nRefer to\n[Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)\nfor more details.\nIf you specify a model, the following models typically have the best\nperformance:\n\n- phone_call (best for Agent Assist and telephony)\n- latest_short (best for Dialogflow non-telephony)\n- command_and_search Leave this field unspecified to use [Agent Speech\n settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) for model selection.\n\n### setModel\n\nWhich Speech model to select. Select the\nmodel best suited to your domain to get best results. If a model is not\nexplicitly specified, then Dialogflow auto-selects a model based on other\nparameters in the SpeechToTextConfig and Agent settings.\n\nIf enhanced speech model is enabled for the agent and an enhanced\nversion of the specified model for the language does not exist, then the\nspeech is recognized using the standard version of the specified model.\nRefer to\n[Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)\nfor more details.\nIf you specify a model, the following models typically have the best\nperformance:\n\n- phone_call (best for Agent Assist and telephony)\n- latest_short (best for Dialogflow non-telephony)\n- command_and_search Leave this field unspecified to use [Agent Speech\n settings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech) for model selection.\n\n### getPhraseSets\n\nList of names of Cloud Speech phrase sets that are used for transcription.\n\nFor phrase set limitations, please refer to [Cloud Speech API quotas and\nlimits](https://cloud.google.com/speech-to-text/quotas#content).\n\n### setPhraseSets\n\nList of names of Cloud Speech phrase sets that are used for transcription.\n\nFor phrase set limitations, please refer to [Cloud Speech API quotas and\nlimits](https://cloud.google.com/speech-to-text/quotas#content).\n\n### getAudioEncoding\n\nAudio encoding of the audio content to process.\n\n### setAudioEncoding\n\nAudio encoding of the audio content to process.\n\n### getSampleRateHertz\n\nSample rate (in Hertz) of the audio content sent in the query.\n\nRefer to [Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics) for\nmore details.\n\n### setSampleRateHertz\n\nSample rate (in Hertz) of the audio content sent in the query.\n\nRefer to [Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics) for\nmore details.\n\n### getLanguageCode\n\nThe language of the supplied audio. Dialogflow does not do\ntranslations. See [Language\nSupport](https://cloud.google.com/dialogflow/docs/reference/language)\nfor a list of the currently supported language codes. Note that queries in\nthe same session do not necessarily need to specify the same language.\n\n### setLanguageCode\n\nThe language of the supplied audio. Dialogflow does not do\ntranslations. See [Language\nSupport](https://cloud.google.com/dialogflow/docs/reference/language)\nfor a list of the currently supported language codes. Note that queries in\nthe same session do not necessarily need to specify the same language.\n\n### getEnableWordInfo\n\nIf `true`, Dialogflow returns\n[SpeechWordInfo](/php/docs/reference/cloud-dialogflow/latest/V2.SpeechWordInfo) in\n[StreamingRecognitionResult](/php/docs/reference/cloud-dialogflow/latest/V2.StreamingRecognitionResult)\nwith information about the recognized speech words, e.g. start and end time\noffsets. If false or unspecified, Speech doesn't return any word-level\ninformation.\n\n### setEnableWordInfo\n\nIf `true`, Dialogflow returns\n[SpeechWordInfo](/php/docs/reference/cloud-dialogflow/latest/V2.SpeechWordInfo) in\n[StreamingRecognitionResult](/php/docs/reference/cloud-dialogflow/latest/V2.StreamingRecognitionResult)\nwith information about the recognized speech words, e.g. start and end time\noffsets. If false or unspecified, Speech doesn't return any word-level\ninformation.\n\n### getUseTimeoutBasedEndpointing\n\nUse timeout based endpointing, interpreting endpointer sensitivity as\nseconds of timeout value.\n\n### setUseTimeoutBasedEndpointing\n\nUse timeout based endpointing, interpreting endpointer sensitivity as\nseconds of timeout value."]]