Table of Contents

Class SpeechConfig

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Config for speech generation and transcription.

public record SpeechConfig : IEquatable<SpeechConfig>
Inheritance
SpeechConfig
Implements
Inherited Members

Properties

LanguageCode

Optional. The language code (ISO 639-1) for the speech synthesis.

[JsonPropertyName("languageCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? LanguageCode { get; set; }

Property Value

string

MultiSpeakerVoiceConfig

The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with voice_config.

[JsonPropertyName("multiSpeakerVoiceConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public MultiSpeakerVoiceConfig? MultiSpeakerVoiceConfig { get; set; }

Property Value

MultiSpeakerVoiceConfig

VoiceConfig

The configuration in case of single-voice output.

[JsonPropertyName("voiceConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public VoiceConfig? VoiceConfig { get; set; }

Property Value

VoiceConfig

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SpeechConfig object.

public static SpeechConfig? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SpeechConfig

The deserialized SpeechConfig object, or null if deserialization fails.