public sealed class TranslateSpeechConfig : IMessage<TranslateSpeechConfig>, IEquatable<TranslateSpeechConfig>, IDeepCloneable<TranslateSpeechConfig>, IBufferMessage, IMessage
Reference documentation and code samples for the Media Translation v1beta1 API class TranslateSpeechConfig.
Provides information to the speech translation that specifies how to process
the request.
Required. Encoding of audio data.
Supported formats:
linear16
Uncompressed 16-bit signed little-endian samples (Linear PCM).
flac
flac (Free Lossless Audio Codec) is the recommended encoding
because it is lossless--therefore recognition is not compromised--and
requires only about half the bandwidth of linear16.
mulaw
8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.
amr
Adaptive Multi-Rate Narrowband codec. sample_rate_hertz must be 8000.
amr-wb
Adaptive Multi-Rate Wideband codec. sample_rate_hertz must be 16000.
ogg-opus
Opus encoded audio frames in Ogg
container. sample_rate_hertz must be one of 8000, 12000, 16000, 24000,
or 48000.
mp3
MP3 audio. Support all standard MP3 bitrates (which range from 32-320
kbps). When using this encoding, sample_rate_hertz has to match the
sample rate of the file being used.
Optional. google-provided-model/video and
google-provided-model/enhanced-phone-call are premium models.
google-provided-model/phone-call is not premium model.
Optional. Sample rate in Hertz of the audio data. Valid values are:
8000-48000. 16000 is optimal. For best results, set the sampling rate of
the audio source to 16000 Hz. If that's not possible, use the native sample
rate of the audio source (instead of re-sampling).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTranslateSpeechConfig\u003c/code\u003e class, part of the Media Translation v1beta1 API, configures speech translation requests, specifying how audio should be processed.\u003c/p\u003e\n"],["\u003cp\u003eThis class offers properties such as \u003ccode\u003eAudioEncoding\u003c/code\u003e, supporting various formats like \u003ccode\u003elinear16\u003c/code\u003e, \u003ccode\u003eflac\u003c/code\u003e, \u003ccode\u003emp3\u003c/code\u003e, and \u003ccode\u003eogg-opus\u003c/code\u003e, each with specific usage guidelines.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eModel\u003c/code\u003e property allows the selection of different translation models, including premium options like \u003ccode\u003egoogle-provided-model/video\u003c/code\u003e and \u003ccode\u003egoogle-provided-model/enhanced-phone-call\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSampleRateHertz\u003c/code\u003e is an important property to define the audio sample rate, with 16000 Hz recommended for best results, but allowing a range between 8000-48000 Hz.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSourceLanguageCode\u003c/code\u003e and \u003ccode\u003eTargetLanguageCode\u003c/code\u003e properties are required to specify the input audio language and the desired output language respectively, using BCP-47 language codes.\u003c/p\u003e\n"]]],[],null,["# Media Translation v1beta1 API - Class TranslateSpeechConfig (2.0.0-beta05)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.0-beta05 (latest)](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/latest/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig)\n- [2.0.0-beta04](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/2.0.0-beta04/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig)\n- [1.0.0-beta03](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/1.0.0-beta03/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig) \n\n public sealed class TranslateSpeechConfig : IMessage\u003cTranslateSpeechConfig\u003e, IEquatable\u003cTranslateSpeechConfig\u003e, IDeepCloneable\u003cTranslateSpeechConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Media Translation v1beta1 API class TranslateSpeechConfig.\n\nProvides information to the speech translation that specifies how to process\nthe request. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TranslateSpeechConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TranslateSpeechConfig](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/latest/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TranslateSpeechConfig](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/latest/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TranslateSpeechConfig](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/latest/Google.Cloud.MediaTranslation.V1Beta1.TranslateSpeechConfig), [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.MediaTranslation.V1Beta1](/dotnet/docs/reference/Google.Cloud.MediaTranslation.V1Beta1/latest/Google.Cloud.MediaTranslation.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.MediaTranslation.V1Beta1.dll\n\nConstructors\n------------\n\n### TranslateSpeechConfig()\n\n public TranslateSpeechConfig()\n\n### TranslateSpeechConfig(TranslateSpeechConfig)\n\n public TranslateSpeechConfig(TranslateSpeechConfig other)\n\nProperties\n----------\n\n### AudioEncoding\n\n public string AudioEncoding { get; set; }\n\nRequired. Encoding of audio data.\nSupported formats:\n\n- `linear16`\n\n Uncompressed 16-bit signed little-endian samples (Linear PCM).\n- `flac`\n\n `flac` (Free Lossless Audio Codec) is the recommended encoding\n because it is lossless--therefore recognition is not compromised--and\n requires only about half the bandwidth of `linear16`.\n- `mulaw`\n\n 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law.\n- `amr`\n\n Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000.\n- `amr-wb`\n\n Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000.\n- `ogg-opus`\n\n Opus encoded audio frames in [Ogg](https://wikipedia.org/wiki/Ogg)\n container. `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000,\n or 48000.\n- `mp3`\n\n MP3 audio. Support all standard MP3 bitrates (which range from 32-320\n kbps). When using this encoding, `sample_rate_hertz` has to match the\n sample rate of the file being used.\n\n### Model\n\n public string Model { get; set; }\n\nOptional. `google-provided-model/video` and\n`google-provided-model/enhanced-phone-call` are premium models.\n`google-provided-model/phone-call` is not premium model.\n\n### SampleRateHertz\n\n public int SampleRateHertz { get; set; }\n\nOptional. Sample rate in Hertz of the audio data. Valid values are:\n8000-48000. 16000 is optimal. For best results, set the sampling rate of\nthe audio source to 16000 Hz. If that's not possible, use the native sample\nrate of the audio source (instead of re-sampling).\n\n### SourceLanguageCode\n\n public string SourceLanguageCode { get; set; }\n\nRequired. Source language code (BCP-47) of the input audio.\n\n### TargetLanguageCode\n\n public string TargetLanguageCode { get; set; }\n\nRequired. Target language code (BCP-47) of the output."]]