Class Voice
- Namespace
- GenerativeAI.Types
- Assembly
- GenerativeAI.dll
A voice: a custom voice created with POST /voices (designed from a prompt or replicated from audio) or a
prebuilt system voice from Google's voice catalog (returned by GET /voices). Use its
Key / Id as the voice of a text-to-speech request.
public sealed class Voice
- Inheritance
-
Voice
- Inherited Members
- Extension Methods
Properties
Accent
Regional accent descriptor (e.g. "American", "British").
[JsonPropertyName("accent")]
public string? Accent { get; set; }
Property Value
Context
Optimal usage context or domain (e.g. "Conversational", "Audiobook", "News").
[JsonPropertyName("context")]
public string? Context { get; set; }
Property Value
Description
Descriptive summary of vocal timbre, personality and tone.
[JsonPropertyName("description")]
public string? Description { get; set; }
Property Value
DisplayName
User-provided display name of a stored voice, or the catalog name of a prebuilt voice.
[JsonPropertyName("display_name")]
public string? DisplayName { get; set; }
Property Value
ExpireTime
Output only. When a voice that was not stored expires (RFC 3339).
[JsonPropertyName("expire_time")]
public string? ExpireTime { get; set; }
Property Value
ExtensionData
Fields this SDK does not model yet.
[JsonExtensionData]
public Dictionary<string, JsonElement>? ExtensionData { get; set; }
Property Value
Gender
Perceived gender presentation (e.g. "female", "male", "neutral").
[JsonPropertyName("gender")]
public string? Gender { get; set; }
Property Value
Id
Output only. The voice ID.
[JsonPropertyName("id")]
public string? Id { get; set; }
Property Value
Key
Output only. The key used to reference this voice in speech generation requests.
[JsonPropertyName("key")]
public string? Key { get; set; }
Property Value
LanguageCode
Primary BCP-47 language tag (e.g. "en-US").
[JsonPropertyName("language_code")]
public string? LanguageCode { get; set; }
Property Value
Model
The model used to design or replicate the voice. If omitted when creating a voice, the latest supported voice design model is used.
[JsonPropertyName("model")]
public string? Model { get; set; }
Property Value
Persona
Intended persona or character archetype (e.g. "Warm, Friendly", "Narrator").
[JsonPropertyName("persona")]
public string? Persona { get; set; }
Property Value
Pitch
Vocal pitch (see VoicePitches).
[JsonPropertyName("pitch")]
public string? Pitch { get; set; }
Property Value
Prompted
Parameters of a prompted (designed) voice. Required when Type is prompted.
[JsonPropertyName("prompted")]
public PromptedVoice? Prompted { get; set; }
Property Value
RegionCode
ISO 3166-1 alpha-2 or UN M.49 region code (e.g. "US", "001").
[JsonPropertyName("region_code")]
public string? RegionCode { get; set; }
Property Value
Replicated
Input only. Parameters of a replicated voice. Required when Type is replicated.
[JsonPropertyName("replicated")]
public ReplicatedVoice? Replicated { get; set; }
Property Value
SampleAudio
A sample of the voice.
[JsonPropertyName("sample_audio")]
public VoiceAudioData? SampleAudio { get; set; }
Property Value
Type
Required. The voice type (see VoiceTypes).
[JsonPropertyName("type")]
public string? Type { get; set; }
Property Value
Usage
Output only. Token usage of the voice creation.
[JsonPropertyName("usage")]
public InteractionUsage? Usage { get; set; }