Table of Contents

Class VoiceActivity

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

Voice activity signal.

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

Properties

AudioOffset

The time voice activity detected in audio time, relative to the start of the audio stream.

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

Property Value

string

VoiceActivityType

The type of the voice activity signal.

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

Property Value

VoiceActivityType?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a VoiceActivity object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

VoiceActivity

The deserialized VoiceActivity object, or null if deserialization fails.