Table of Contents

Class RAWAudioFrameEventArgs

Namespace
VisioForge.Core.Types
Assembly
VisioForge.Core.dll

Provides data for events that deliver raw audio frames. This class encapsulates a VisioForge.Core.Types.RAWAudioFrame, allowing it to be passed as an argument in event handlers.

public class RAWAudioFrameEventArgs : EventArgs

Inheritance

Inherited Members

Examples

// Assume an event handler is registered for a raw audio frame event.
public void OnRawAudioFrameReceived(object sender, RAWAudioFrameEventArgs e)
{
    RAWAudioFrame rawFrame = e.Frame;

    // Access raw audio data and information
    Console.WriteLine($"Raw audio frame received: Size = {rawFrame.DataSize} bytes, Timestamp = {rawFrame.Timestamp} ms");

    // Convert to AudioFrame for easier manipulation if needed
    AudioFrame audioFrame = rawFrame.ToAudioFrame();
    // Process audioFrame...
}

Remarks

This event argument is typically used in scenarios where an application needs to process raw audio data directly, such as for custom audio analysis, visualization, real-time effects, or machine learning applications. The Frame property provides access to the raw audio buffer and its associated metadata. When handling events of this type, be aware that the audio data pointer may only be valid for the duration of the event handler. If you need to retain the audio data, copy it to a managed buffer or convert it to an AudioFrame before the handler returns. Common use cases include audio metering, spectrum analysis, voice activity detection, or feeding audio to custom processing pipelines.

Constructors

RAWAudioFrameEventArgs(RAWAudioFrame)

Initializes a new instance of the VisioForge.Core.Types.RAWAudioFrameEventArgs class.

public RAWAudioFrameEventArgs(RAWAudioFrame frame)

Parameters

frame RAWAudioFrame

The VisioForge.Core.Types.RAWAudioFrame to be encapsulated by these event arguments.

Properties

Frame

Gets the VisioForge.Core.Types.RAWAudioFrame associated with this event. This frame contains the raw audio data and its metadata.

public RAWAudioFrame Frame { get; }

Property Value

RAWAudioFrame