Table of Contents

Interface IAudioVolumeMute

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

Defines an interface for controlling audio volume and muting capabilities. This interface provides methods to check support, set/get mute status, and set/get volume levels.

public interface IAudioVolumeMute

Examples

// Assume 'audioControl' is an instance of a class implementing IAudioVolumeMute.
IAudioVolumeMute audioControl = GetAudioControlInstance();

if (audioControl.IsSupported())
{
    // Mute the audio.
    audioControl.SetMute(true);
    Console.WriteLine($"Audio muted: {audioControl.GetMute()}");

    // Set the volume to 50%.
    audioControl.SetVolume(0.5);
    Console.WriteLine($"Audio volume: {audioControl.GetVolume()}");

    // Unmute the audio.
    audioControl.SetMute(false);
}

Remarks

Implementations of this interface are typically found in audio processing elements or renderers within the MediaBlocks framework. It allows for programmatic control over the audio output.

Methods

GetMute()

Gets the current mute state of the audio.

bool GetMute()

Returns

bool

true if the audio is muted; otherwise, false.

GetVolume()

Gets the current audio volume level.

double GetVolume()

Returns

double

A double value representing the current volume, typically in the range of 0.0 to 1.0.

IsSupported()

Determines whether this audio volume and mute interface is supported by the current component.

bool IsSupported()

Returns

bool

true if this interface is supported; otherwise, false.

SetInterface(IAudioVolumeMute)

Sets an internal interface for audio volume and mute control. This method is typically used by the framework to link different components that manage audio.

void SetInterface(IAudioVolumeMute intf)

Parameters

intf IAudioVolumeMute

The VisioForge.Core.Types.X.IAudioVolumeMute interface to set.

SetMute(bool)

Sets the mute state of the audio.

void SetMute(bool mute)

Parameters

mute bool

If set to true, the audio will be muted; otherwise, it will be unmuted.

SetVolume(double)

Sets the audio volume level.

void SetVolume(double volume)

Parameters

volume double

The volume level, typically a double value in the range of 0.0 (silent) to 1.0 (full volume). Values outside this range might be clamped or result in amplification depending on the implementation.