public sealed class SpeechToTextConfig : IMessage<SpeechToTextConfig>, IEquatable<SpeechToTextConfig>, IDeepCloneable<SpeechToTextConfig>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class SpeechToTextConfig.
Configures speech transcription for
[ConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfile].
If true, Dialogflow returns
[SpeechWordInfo][google.cloud.dialogflow.v2beta1.SpeechWordInfo] in
[StreamingRecognitionResult][google.cloud.dialogflow.v2beta1.StreamingRecognitionResult]
with 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.
The language of the supplied audio. Dialogflow does not do translations.
See Language
Support
for a list of the currently supported language codes. Note that queries in
the same session do not necessarily need to specify the same language.
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 to
Cloud Speech API
documentation
for more details.
If you specify a model, the following models typically have the best
performance:
List of names of Cloud Speech phrase sets that are used for transcription.
For phrase set limitations, please refer to Cloud Speech API quotas and
limits.
public SpeechModelVariant SpeechModelVariant { get; set; }
The speech model used in speech to text.
SPEECH_MODEL_VARIANT_UNSPECIFIED, USE_BEST_AVAILABLE will be treated as
USE_ENHANCED. It can be overridden in
[AnalyzeContentRequest][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest]
and
[StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest]
request. 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.
[[["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-03 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSpeechToTextConfig\u003c/code\u003e class in the Google Cloud Dialogflow v2beta1 API configures speech transcription for ConversationProfiles.\u003c/p\u003e\n"],["\u003cp\u003eThis class allows specifying properties such as \u003ccode\u003eAudioEncoding\u003c/code\u003e, \u003ccode\u003eLanguageCode\u003c/code\u003e, \u003ccode\u003eModel\u003c/code\u003e, \u003ccode\u003ePhraseSets\u003c/code\u003e, \u003ccode\u003eSampleRateHertz\u003c/code\u003e, and \u003ccode\u003eSpeechModelVariant\u003c/code\u003e to customize how audio is processed.\u003c/p\u003e\n"],["\u003cp\u003eIt also allows to enable \u003ccode\u003eEnableWordInfo\u003c/code\u003e to have word-level information, and \u003ccode\u003eUseTimeoutBasedEndpointing\u003c/code\u003e to set timeout value for endpointing.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSpeechToTextConfig\u003c/code\u003e class implements multiple interfaces, including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing various functionalities for handling messages and cloning objects.\u003c/p\u003e\n"],["\u003cp\u003eThe properties \u003ccode\u003ePhraseSets\u003c/code\u003e and \u003ccode\u003ePhraseSetsAsPhraseSetNames\u003c/code\u003e provides a way to use Cloud Speech phrase sets for transcription, along with reference to the speech api documentation for more information.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Dialogflow v2beta1 API - Class SpeechToTextConfig (1.0.0-beta23)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta23 (latest)](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig)\n- [1.0.0-beta22](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/1.0.0-beta22/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig) \n\n public sealed class SpeechToTextConfig : IMessage\u003cSpeechToTextConfig\u003e, IEquatable\u003cSpeechToTextConfig\u003e, IDeepCloneable\u003cSpeechToTextConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class SpeechToTextConfig.\n\nConfigures speech transcription for\n\\[ConversationProfile\\]\\[google.cloud.dialogflow.v2beta1.ConversationProfile\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SpeechToTextConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SpeechToTextConfig](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SpeechToTextConfig](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SpeechToTextConfig](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Dialogflow.V2Beta1](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.Dialogflow.V2Beta1.dll\n\nConstructors\n------------\n\n### SpeechToTextConfig()\n\n public SpeechToTextConfig()\n\n### SpeechToTextConfig(SpeechToTextConfig)\n\n public SpeechToTextConfig(SpeechToTextConfig other)\n\nProperties\n----------\n\n### AudioEncoding\n\n public AudioEncoding AudioEncoding { get; set; }\n\nAudio encoding of the audio content to process.\n\n### EnableWordInfo\n\n public bool EnableWordInfo { get; set; }\n\nIf `true`, Dialogflow returns\n\\[SpeechWordInfo\\]\\[google.cloud.dialogflow.v2beta1.SpeechWordInfo\\] in\n\\[StreamingRecognitionResult\\]\\[google.cloud.dialogflow.v2beta1.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### LanguageCode\n\n public string LanguageCode { get; set; }\n\nThe language of the supplied audio. Dialogflow does not do translations.\nSee [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### Model\n\n public string Model { get; set; }\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.\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\n\nLeave this field unspecified to use\n[Agent Speech\nsettings](https://cloud.google.com/dialogflow/cx/docs/concept/agent#settings-speech)\nfor model selection.\n\n### PhraseSets\n\n public RepeatedField\u003cstring\u003e PhraseSets { get; }\n\nList of names of Cloud Speech phrase sets that are used for transcription.\nFor phrase set limitations, please refer to [Cloud Speech API quotas and\nlimits](https://cloud.google.com/speech-to-text/quotas#content).\n\n### PhraseSetsAsPhraseSetNames\n\n public ResourceNameList\u003cPhraseSetName\u003e PhraseSetsAsPhraseSetNames { get; }\n\n[PhraseSetName](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.PhraseSetName)-typed view over the [PhraseSets](/dotnet/docs/reference/Google.Cloud.Dialogflow.V2Beta1/latest/Google.Cloud.Dialogflow.V2Beta1.SpeechToTextConfig#Google_Cloud_Dialogflow_V2Beta1_SpeechToTextConfig_PhraseSets) resource name property.\n\n### SampleRateHertz\n\n public int SampleRateHertz { get; set; }\n\nSample rate (in Hertz) of the audio content sent in the query.\nRefer to\n[Cloud Speech API\ndocumentation](https://cloud.google.com/speech-to-text/docs/basics) for\nmore details.\n\n### SpeechModelVariant\n\n public SpeechModelVariant SpeechModelVariant { get; set; }\n\nThe speech model used in speech to text.\n`SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as\n`USE_ENHANCED`. It can be overridden in\n\\[AnalyzeContentRequest\\]\\[google.cloud.dialogflow.v2beta1.AnalyzeContentRequest\\]\nand\n\\[StreamingAnalyzeContentRequest\\]\\[google.cloud.dialogflow.v2beta1.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### UseTimeoutBasedEndpointing\n\n public bool UseTimeoutBasedEndpointing { get; set; }\n\nUse timeout based endpointing, interpreting endpointer sensitivity as\nseconds of timeout value."]]