Table of Contents

Class VoiceConfig

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

The configuration for the voice to use.

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

Properties

PrebuiltVoiceConfig

The configuration for a prebuilt voice.

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

Property Value

PrebuiltVoiceConfig

ReplicatedVoiceConfig

The configuration for a replicated voice, which is a clone of a user's voice that can be used for speech synthesis. If this is unset, a default voice is used.

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

Property Value

ReplicatedVoiceConfig

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a VoiceConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

VoiceConfig

The deserialized VoiceConfig object, or null if deserialization fails.