Table of Contents

Class SpeakerVoiceConfig

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

Configuration for a single speaker in a multi-speaker setup.

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

Properties

Speaker

The name of the speaker. This should be the same as the speaker name used in the prompt.

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

Property Value

string

VoiceConfig

The configuration for the voice of this speaker.

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

Property Value

VoiceConfig

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a SpeakerVoiceConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

SpeakerVoiceConfig

The deserialized SpeakerVoiceConfig object, or null if deserialization fails.