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 IAudioVolumeMuteExamples
// 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
-
trueif 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
-
trueif 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
intfIAudioVolumeMute-
The VisioForge.Core.Types.X.IAudioVolumeMute interface to set.
SetMute(bool)
Sets the mute state of the audio.
void SetMute(bool mute)Parameters
mutebool-
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
volumedouble-
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.