Table of Contents

Class AudioSystemObject

Namespace
NAudio.MacOS.CoreAudio
Assembly
NAudio.MacOS.dll

Provides the audio system object, that is the base API where all other Core Audio API's are accessed from.
Inherits from the AudioObject class, and only has a single instance, queried by the Instance field.

public sealed class AudioSystemObject : AudioObject, IEquatable<AudioObject>, IEqualityOperators<AudioObject, AudioObject, bool>
Inheritance
AudioSystemObject
Implements
Inherited Members

Fields

Instance

Gets the single and only instance of the AudioSystemObject class.

public static readonly AudioSystemObject Instance

Field Value

AudioSystemObject

Properties

ClockDeviceList

An array of AudioClockDevice that represent all the audio clock device objects currently provided by the system.

public AudioClockDevice[] ClockDeviceList { get; }

Property Value

AudioClockDevice[]

DefaultInputDevice

The AudioDevice of the default input AudioDevice.

public AudioDevice DefaultInputDevice { get; }

Property Value

AudioDevice

DefaultOutputDevice

The AudioDevice of the default output AudioDevice.

public AudioDevice DefaultOutputDevice { get; }

Property Value

AudioDevice

DefaultSystemOutputDevice

The output AudioDevice to use for system related sound from the alert sound to digital call progress.

public AudioDevice DefaultSystemOutputDevice { get; }

Property Value

AudioDevice

Devices

Gets an array of AudioDevice objects that represent all the audio devices currently available in the system.

public AudioDevice[] Devices { get; }

Property Value

AudioDevice[]

HogModeIsAllowed

A bool where true means that this process wants the HAL to automatically take hog mode and false means that the HAL should not automatically take hog mode on behalf of the process. Processes that only ever use the default device are the sort of that should set this property's value to false.

public bool HogModeIsAllowed { get; set; }

Property Value

bool

Remarks

This property corresponds to Shared/Exclusive mode on WASAPI on Windows. Setting this to true enables the exclusive mode for all audio sessions.

IsInitingOrExiting

A bool whose value will be true if the HAL is either in the midst of initializing or in the midst of exiting the process.

public bool IsInitingOrExiting { get; }

Property Value

bool

MixStereoToMono

A bool where a value of true indicates that AudioDevices should mix stereo signals down to mono. Note that the two channels on the device that comprise the stereo signal are defined on the device by GetPreferredChannelsForStereo(AudioObjectPropertyScope).

public bool MixStereoToMono { get; set; }

Property Value

bool

PowerHint

A UInt32 whose values are drawn from the AudioHardwarePowerHint enum. Only those values are allowed. This property allows a process to indicate how aggressive the system can be with optimizations that save power. The default value is None. Note that the value of this property can be set in an application's info.plist using the key, "AudioHardwarePowerHint". The values for this key are the strings that correspond to the values in the Power Hints enum.

public AudioHardwarePowerHint PowerHint { get; set; }

Property Value

AudioHardwarePowerHint

ProcessInputMute

A bool where a true value indicates that all data coming into the process for all devices will be silent. A value of false indicates that input data will be received normally.

public bool ProcessInputMute { get; set; }

Property Value

bool

ProcessIsAudible

A bool where a true value indicates that the audio of the process will be heard. A value of false indicates that all audio in the process will not be heard.

public bool ProcessIsAudible { get; set; }

Property Value

bool

ProcessIsMain

A bool where true means that the current process contains the main instance of the HAL. The main instance of the HAL is the only instance in which plug-ins should save/restore their devices' settings.

public bool ProcessIsMain { get; }

Property Value

bool

ProcessObjectList

An array of Process objects for all client processes currently connected to the system.

public Process[] ProcessObjectList { get; }

Property Value

Process[]

SleepingIsAllowed

A bool where true means that the process will allow the CPU to idle sleep even if there is audio IO in progress. A false means that the CPU will not be allowed to idle sleep. Note that this property won't affect when the CPU is forced to sleep.

public bool SleepingIsAllowed { get; set; }

Property Value

bool

UnloadingIsAllowed

A bool where true means that this process wants the HAL to unload itself after a period of inactivity where there are no IOProcs and no listeners registered with any AudioObject.

public bool UnloadingIsAllowed { get; set; }

Property Value

bool

UserSessionIsActiveOrHeadless

A bool where a value of true indicates that the login session of the user of the process is either an active console session or a headless session.

public bool UserSessionIsActiveOrHeadless { get; set; }

Property Value

bool

Methods

ConvertPIDToProcessObject(int)

This method fetches the Process object that has the given PID. The PID is passed in to the pid parameter while the Process is returned to the caller as the method's data.
Note that an error is not returned if the PID doesn't refer to any Process.
Rather, this method will return null.

public Process ConvertPIDToProcessObject(int pid)

Parameters

pid int

The PID of the audio process object to query.

Returns

Process

ConvertUIDToClockDevice(string)

This property fetches the AudioClockDevice that corresponds to the audio clock device that has the given UID.
The UID is passed in via the uid parameter while the AudioClockDevice is returned to the caller as the method's return value.
Note that an error is not returned if the UID doesn't refer to any AudioClockDevice.
Rather, this method will return null.

public AudioClockDevice ConvertUIDToClockDevice(string uid)

Parameters

uid string

Returns

AudioClockDevice

ConvertUIDToDevice(string)

This method fetches the AudioDevice that corresponds to the physical audio device that has the given UID.
The UID is passed in via the uid parameter while the AudioDevice is returned to the caller as the return value.
Note that an error is not returned if the UID doesn't refer to any AudioDevices.
Rather, this method will return null.

public AudioDevice ConvertUIDToDevice(string uid)

Parameters

uid string

The UID of the device to query.

Returns

AudioDevice

The AudioDevice instance of the device referred by the specified uid, or null if it does not refer to any device.

OnUserIDChanged()

This method exists so that clients can tell the HAL when they are changing the effective user ID of the process. The way it works is that a client will call this method and the HAL will flush all its cached per-user preferences such as the default devices. Clients calling this are using it to trigger the cache flush.

public void OnUserIDChanged()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Events

DefaultInputDeviceChanged

Event that clients can be informed when the default input device is changed.

public event AudioObjectPropertyListenerDelegate DefaultInputDeviceChanged

Event Type

AudioObjectPropertyListenerDelegate

DefaultOutputDeviceChanged

Event that clients can be informed when the default output device is changed.

public event AudioObjectPropertyListenerDelegate DefaultOutputDeviceChanged

Event Type

AudioObjectPropertyListenerDelegate

DefaultSystemOutputDeviceChanged

Event that clients can be informed when the default system output device is changed.

public event AudioObjectPropertyListenerDelegate DefaultSystemOutputDeviceChanged

Event Type

AudioObjectPropertyListenerDelegate

DeviceListChanged

Event that clients can be informed when the list of devices has been changed.
This particular list changes when a device is added or removed from the HAL.

public event AudioObjectPropertyListenerDelegate DeviceListChanged

Event Type

AudioObjectPropertyListenerDelegate

ServiceRestarted

Event that clients can be informed when the service has been reset for some reason. When a reset happens, any state the client has, such as cached data or added listeners, must be re-established by the client.

public event AudioObjectPropertyListenerDelegate ServiceRestarted

Event Type

AudioObjectPropertyListenerDelegate