Class WasapiAudioDevices
Windows devices through WASAPI, in shared mode, chosen by part of their friendly name, e.g. Headset.
Implements
Inherited Members
Namespace: Uniform.Matrix.Audio
Assembly: Uniform.Matrix.Audio.dll
Syntax
public sealed class WasapiAudioDevices : IAudioDevices
Remarks
Uses NAudio's WasapiCapture and WasapiOut, which NAudio 3 marks obsolete in favour of builders whose recorder no longer is an NAudio.Wave.IWaveIn; these still are, and work. Not yet tried on Windows.
Constructors
| Edit this page View SourceWasapiAudioDevices(string?, string?)
Windows devices through WASAPI, in shared mode, chosen by part of their friendly name, e.g. Headset.
Declaration
public WasapiAudioDevices(string? microphone = null, string? speaker = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | microphone | Part of the microphone's name; the default one when null or empty, or when none matches. |
| string | speaker | Part of the speaker's name; the default one when null or empty, or when none matches. |
Remarks
Uses NAudio's WasapiCapture and WasapiOut, which NAudio 3 marks obsolete in favour of builders whose recorder no longer is an NAudio.Wave.IWaveIn; these still are, and work. Not yet tried on Windows.
Methods
| Edit this page View SourceListMicrophones()
Return the active capture devices.
Declaration
public IReadOnlyList<AudioDevice> ListMicrophones()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AudioDevice> |
ListSpeakers()
Return the active playback devices.
Declaration
public IReadOnlyList<AudioDevice> ListSpeakers()
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AudioDevice> |
OpenMicrophone()
Open the capture device; it records in the system's mix format, which MicrophoneFrames converts.
Declaration
public IWaveIn OpenMicrophone()
Returns
| Type | Description |
|---|---|
| IWaveIn |
OpenSpeaker()
Open the playback device, fed in its own mix format, as WASAPI's shared mode does not convert sample rates.
Declaration
public IWavePlayer OpenSpeaker()
Returns
| Type | Description |
|---|---|
| IWavePlayer |