Table of Contents

Class ReplicatedVoiceConfig

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

The configuration for the replicated voice to use.

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

Properties

MimeType

The mimetype of the voice sample. The only currently supported value is audio/wav. This represents 16-bit signed little-endian wav data, with a 24kHz sampling rate.

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

Property Value

string

VoiceSampleAudio

The sample of the custom voice.

[JsonPropertyName("voiceSampleAudio")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public byte[]? VoiceSampleAudio { get; set; }

Property Value

byte[]

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ReplicatedVoiceConfig object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ReplicatedVoiceConfig

The deserialized ReplicatedVoiceConfig object, or null if deserialization fails.