Class LiveMusicAudioChunkReceivedEventArgs
- Namespace
- GenerativeAI.Live
- Assembly
- GenerativeAI.Live.dll
Provides data for the AudioChunkReceived event.
public class LiveMusicAudioChunkReceivedEventArgs : EventArgs
- Inheritance
-
LiveMusicAudioChunkReceivedEventArgs
- Inherited Members
- Extension Methods
Constructors
LiveMusicAudioChunkReceivedEventArgs(AudioChunk, int, int)
Initializes a new instance of the LiveMusicAudioChunkReceivedEventArgs class.
public LiveMusicAudioChunkReceivedEventArgs(AudioChunk chunk, int sampleRate, int channels)
Parameters
chunkAudioChunkThe audio chunk received from the server.
sampleRateintThe sample rate of the audio, in Hz.
channelsintThe number of audio channels.
Properties
Channels
Gets the number of audio channels. Parsed from the channels= parameter of the MIME type,
or 2 (Lyria RealTime outputs stereo) when not specified.
public int Channels { get; }
Property Value
Chunk
Gets the audio chunk as received from the server.
public AudioChunk Chunk { get; }
Property Value
Data
Gets the decoded raw audio bytes (16-bit PCM unless MimeType says otherwise).
public byte[] Data { get; }
Property Value
- byte[]
MimeType
Gets the MIME type of the audio chunk (for example audio/l16;rate=48000;channels=2), if provided.
public string? MimeType { get; }
Property Value
SampleRate
Gets the sample rate of the audio, in Hz. Parsed from the rate= parameter of the MIME type,
or 48000 (Lyria RealTime's output rate) when not specified.
public int SampleRate { get; }
Property Value
SourceMetadata
Gets the prompts and config used to generate this chunk, if provided by the server.
public LiveMusicSourceMetadata? SourceMetadata { get; }