Class CoreAudioFunctions
Exposes utility methods, some of them are wrapping native functions.
public static class CoreAudioFunctions
- Inheritance
-
CoreAudioFunctions
- Inherited Members
Properties
CurrentHostTime
Gets the current host time.
public static ulong CurrentHostTime { get; }
Property Value
HostClockFrequency
Gets the number of ticks per second in the host time base.
public static double HostClockFrequency { get; }
Property Value
HostClockMinimumTimeDelta
Gets the smallest number of ticks that two succeeding host time values will ever differ by.
public static uint HostClockMinimumTimeDelta { get; }
Property Value
Methods
ConvertHostTimeToSeconds(ulong)
Given a specified host time, it converts the time to an equivalent value in seconds.
public static double ConvertHostTimeToSeconds(ulong hostTime)
Parameters
hostTimeulongThe host time to convert.
Returns
- double
The converted host time value in seconds.
ConvertHostTimeToTimeSpan(ulong)
Given a specified host time, it converts the time to an equivalent TimeSpan instance.
public static TimeSpan ConvertHostTimeToTimeSpan(ulong hostTime)
Parameters
hostTimeulongThe host time to convert.
Returns
GetCurrentDeviceTime(AudioDevice, AudioObjectPropertyScope)
Gets the current time of the specified audio device, if running.
public static double GetCurrentDeviceTime(AudioDevice device, AudioObjectPropertyScope scope)
Parameters
deviceAudioDeviceThe audio device to get it's time.
scopeAudioObjectPropertyScopeThe the audio device time to query for (Input/Output).
Returns
- double
The current time of the audio device, in seconds
Exceptions
- ArgumentNullException
deviceis null.- InvalidOperationException
The specified audio device does not have at least one I/O procedure running.
GetCurrentDeviceTime(AudioDevice, WaveFormat)
Gets the current time of the specified audio device, if running.
public static double GetCurrentDeviceTime(AudioDevice device, WaveFormat intermediateFormat)
Parameters
deviceAudioDeviceThe audio device to get it's time.
intermediateFormatWaveFormatThe currently used virtual format of the audio device.
Returns
- double
The current time of the audio device, in seconds
Exceptions
- ArgumentNullException
deviceand/orintermediateFormatare null.- InvalidOperationException
The specified audio device does not have at least one I/O procedure running.
IsNonInterleavedStream(AudioStream)
Queries the current native virtual audio format of the specified AudioStream
and gets a value whether the currently used HAL virtual format is non-interleaved.
What is a non-interleaved audio format?
All the audio data processed and produced by NAudio IWaveProvider instances are grouped as interleaved samples.
An interleaved sample contains all the sampled values for each channel.
A non-interleaved sample contains a single sampled value for a single channel.
This important distinction is existing in HAL and is used in top-notch professional
audio devices and aggregate devices, and as such when writing a custom CoreAudioIOProcedure
this is only way to know about this distinction.
public static bool IsNonInterleavedStream(AudioStream stream)
Parameters
streamAudioStreamThe AudioStream whose virtual format is to be queried.
Returns
- bool
A value whether the current format used by the stream is non-interleaved.
Exceptions
- ArgumentNullException
streamis null.
IsNonMixableStream(AudioStream)
Queries the current native virtual audio format of the specified AudioStream and gets a value whether the currently used HAL virtual format is non-mixable.
public static bool IsNonMixableStream(AudioStream stream)
Parameters
streamAudioStreamThe AudioStream whose virtual format is to be queried.
Returns
- bool
A value whether the current format used by the stream is non-mixable.
Exceptions
- ArgumentNullException
streamis null.