AudioGraph AudioGraph AudioGraph AudioGraph AudioGraph Class

Definition

Represents an audio graph of connected input, output, and submix nodes that manipulate and route audio.

public : sealed class AudioGraph : IClosable, IAudioGraph, IAudioGraph2, IAudioGraph3
struct winrt::Windows::Media::Audio::AudioGraph : IClosable, IAudioGraph, IAudioGraph2, IAudioGraph3
public sealed class AudioGraph : IDisposable, IAudioGraph, IAudioGraph2, IAudioGraph3
Public NotInheritable Class AudioGraph Implements IDisposable, IAudioGraph, IAudioGraph2, IAudioGraph3
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
backgroundMediaRecording

Remarks

The audio graph is made up of input nodes, output nodes, and submix nodes. Input nodes include audio files, audio devices, and code that generates audio data. Output nodes also include audio files, audio devices, and code that processes audio data. When the graph is started, audio data flows through the graph from the input nodes, through any submix nodes, to the output nodes. Each node can have zero or more audio effects that are applied to the audio data before it is passed to the next node. This class and related APIs enable you to develop audio applications more quickly and easily than the low-level COM XAudio2 APIs. For how-to guidance on using audio graphs, see Audio graphs.

Get an instance of this class by calling AudioGraph.CreateAsync.

The entire audio graph must operate at the same sample rate. Sources can have different sample rates, but are resampled immediately.

Note

If no audio devices are available, the audio graph cannot be instantiated.

AudioGraph cannot be instantiated on the N and KN editions of Windows 8 and Windows 10, unless the optional Media Feature Pack has been installed. For more information, see Media Feature Pack for Windows N editions.

Properties

CompletedQuantumCount CompletedQuantumCount CompletedQuantumCount CompletedQuantumCount CompletedQuantumCount

Gets the completed quantum count for the audio graph.

EncodingProperties EncodingProperties EncodingProperties EncodingProperties EncodingProperties

Gets the encoding properties for the audio graph.

LatencyInSamples LatencyInSamples LatencyInSamples LatencyInSamples LatencyInSamples

Gets the latency in samples that the audio graph supports.

PrimaryRenderDevice PrimaryRenderDevice PrimaryRenderDevice PrimaryRenderDevice PrimaryRenderDevice

Gets the primary render device for the audio graph.

RenderDeviceAudioProcessing RenderDeviceAudioProcessing RenderDeviceAudioProcessing RenderDeviceAudioProcessing RenderDeviceAudioProcessing

Gets a value that indicates the audio processing mode for the audio graph.

SamplesPerQuantum SamplesPerQuantum SamplesPerQuantum SamplesPerQuantum SamplesPerQuantum

Gets the number of samples per quantum at which the audio graph is currently operating.

Methods

Close() Close() Close() Close() Close()

Closes the audio graph and disposes of associated resources.

CreateAsync(AudioGraphSettings) CreateAsync(AudioGraphSettings) CreateAsync(AudioGraphSettings) CreateAsync(AudioGraphSettings) CreateAsync(AudioGraphSettings)

Creates an audio graph with specific settings.

CreateBatchUpdater() CreateBatchUpdater() CreateBatchUpdater() CreateBatchUpdater() CreateBatchUpdater()

Creates a new AudioGraphBatchUpdater for the AudioGraph which causes all subsequent modifications to all nodes in the audio graph to be accumulated and then committed once your app closes or disposes of the batch updater object.

CreateDeviceInputNodeAsync(MediaCategory) CreateDeviceInputNodeAsync(MediaCategory) CreateDeviceInputNodeAsync(MediaCategory) CreateDeviceInputNodeAsync(MediaCategory) CreateDeviceInputNodeAsync(MediaCategory)

Creates an AudioDeviceInputNode that inputs audio data into the audio graph from the default audio input device, such as a microphone or audio card.

CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties)

Creates an AudioDeviceInputNode that inputs audio data into the audio graph from the default audio input device such as a microphone or audio card.

CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation)

Creates an AudioDeviceInputNode that inputs audio data into the audio graph from the specified audio input device such as a microphone or audio card.

CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation, AudioNodeEmitter) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation, AudioNodeEmitter) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation, AudioNodeEmitter) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation, AudioNodeEmitter) CreateDeviceInputNodeAsync(MediaCategory, AudioEncodingProperties, DeviceInformation, AudioNodeEmitter)

Creates a spatial audio-enabled AudioDeviceInputNode that inputs audio data into the audio graph from the specified audio input device such as a microphone or audio card.

CreateDeviceOutputNodeAsync() CreateDeviceOutputNodeAsync() CreateDeviceOutputNodeAsync() CreateDeviceOutputNodeAsync() CreateDeviceOutputNodeAsync()

Creates a new AudioDeviceOutputNode that outputs audio data from the audio graph to the system's default output device, such as speakers or headphones.

CreateFileInputNodeAsync(IStorageFile) CreateFileInputNodeAsync(IStorageFile) CreateFileInputNodeAsync(IStorageFile) CreateFileInputNodeAsync(IStorageFile) CreateFileInputNodeAsync(IStorageFile)

Creates an AudioFileInputNode that inputs audio data into the audio graph from a storage file.

CreateFileInputNodeAsync(IStorageFile, AudioNodeEmitter) CreateFileInputNodeAsync(IStorageFile, AudioNodeEmitter) CreateFileInputNodeAsync(IStorageFile, AudioNodeEmitter) CreateFileInputNodeAsync(IStorageFile, AudioNodeEmitter) CreateFileInputNodeAsync(IStorageFile, AudioNodeEmitter)

Creates a spatial audio-enabled AudioFileInputNode that inputs audio data into the audio graph from a storage file.

CreateFileOutputNodeAsync(IStorageFile) CreateFileOutputNodeAsync(IStorageFile) CreateFileOutputNodeAsync(IStorageFile) CreateFileOutputNodeAsync(IStorageFile) CreateFileOutputNodeAsync(IStorageFile)

Creates a new AudioFileOutuputNode that outputs audio data from the audio graph to the specified storage file.

CreateFileOutputNodeAsync(IStorageFile, MediaEncodingProfile) CreateFileOutputNodeAsync(IStorageFile, MediaEncodingProfile) CreateFileOutputNodeAsync(IStorageFile, MediaEncodingProfile) CreateFileOutputNodeAsync(IStorageFile, MediaEncodingProfile) CreateFileOutputNodeAsync(IStorageFile, MediaEncodingProfile)

Creates a new AudioFileOutuputNode that outputs audio data from the audio graph to the specified storage file.

CreateFrameInputNode() CreateFrameInputNode() CreateFrameInputNode() CreateFrameInputNode() CreateFrameInputNode()

Creates an AudioFrameInputNode that inputs audio data generated by app-implemented code into the audio graph.

CreateFrameInputNode(AudioEncodingProperties) CreateFrameInputNode(AudioEncodingProperties) CreateFrameInputNode(AudioEncodingProperties) CreateFrameInputNode(AudioEncodingProperties) CreateFrameInputNode(AudioEncodingProperties)

Creates an AudioFrameInputNode, with the specified encoding properties, that inputs audio data generated by app-implemented code into the audio graph.

CreateFrameInputNode(AudioEncodingProperties, AudioNodeEmitter) CreateFrameInputNode(AudioEncodingProperties, AudioNodeEmitter) CreateFrameInputNode(AudioEncodingProperties, AudioNodeEmitter) CreateFrameInputNode(AudioEncodingProperties, AudioNodeEmitter) CreateFrameInputNode(AudioEncodingProperties, AudioNodeEmitter)

Creates a spatial audio-enabled AudioFrameInputNode, with the specified encoding properties, that inputs audio data generated by app-implemented code into the audio graph.

CreateFrameOutputNode() CreateFrameOutputNode() CreateFrameOutputNode() CreateFrameOutputNode() CreateFrameOutputNode()

Creates a new AudioDeviceOutputNode that outputs audio data from the audio graph to app-implemented code.

CreateFrameOutputNode(AudioEncodingProperties) CreateFrameOutputNode(AudioEncodingProperties) CreateFrameOutputNode(AudioEncodingProperties) CreateFrameOutputNode(AudioEncodingProperties) CreateFrameOutputNode(AudioEncodingProperties)

Creates a new AudioDeviceOutputNode, with the specified encoding properties, that outputs audio data from the audio graph to app-implemented code.

CreateMediaSourceAudioInputNodeAsync(MediaSource) CreateMediaSourceAudioInputNodeAsync(MediaSource) CreateMediaSourceAudioInputNodeAsync(MediaSource) CreateMediaSourceAudioInputNodeAsync(MediaSource) CreateMediaSourceAudioInputNodeAsync(MediaSource)

Creates a MediaSourceAudioInputNode that inputs audio data into the audio graph from the provided MediaSource object.

CreateMediaSourceAudioInputNodeAsync(MediaSource, AudioNodeEmitter) CreateMediaSourceAudioInputNodeAsync(MediaSource, AudioNodeEmitter) CreateMediaSourceAudioInputNodeAsync(MediaSource, AudioNodeEmitter) CreateMediaSourceAudioInputNodeAsync(MediaSource, AudioNodeEmitter) CreateMediaSourceAudioInputNodeAsync(MediaSource, AudioNodeEmitter)

Creates a spatial audio-enabled MediaSourceAudioInputNode that inputs audio data into the audio graph from the provided MediaSource object.

CreateSubmixNode() CreateSubmixNode() CreateSubmixNode() CreateSubmixNode() CreateSubmixNode()

Creates an AudioSubmixNode that mixes the output of one or more audio graph nodes into a single output that can be connected to output nodes or other submix nodes.

CreateSubmixNode(AudioEncodingProperties) CreateSubmixNode(AudioEncodingProperties) CreateSubmixNode(AudioEncodingProperties) CreateSubmixNode(AudioEncodingProperties) CreateSubmixNode(AudioEncodingProperties)

Creates an AudioSubmixNode that mixes the output of one or more audio graph nodes into a single output that can be connected to output nodes or other submix nodes.

CreateSubmixNode(AudioEncodingProperties, AudioNodeEmitter) CreateSubmixNode(AudioEncodingProperties, AudioNodeEmitter) CreateSubmixNode(AudioEncodingProperties, AudioNodeEmitter) CreateSubmixNode(AudioEncodingProperties, AudioNodeEmitter) CreateSubmixNode(AudioEncodingProperties, AudioNodeEmitter)

Creates a spatial audio-enabled AudioSubmixNode that mixes the output of one or more audio graph nodes into a single output that can be connected to output nodes or other submix nodes.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

ResetAllNodes() ResetAllNodes() ResetAllNodes() ResetAllNodes() ResetAllNodes()

Resets all nodes in the audio graph.

Start() Start() Start() Start() Start()

Starts the audio graph.

Stop() Stop() Stop() Stop() Stop()

Stops the audio graph.

Events

QuantumProcessed QuantumProcessed QuantumProcessed QuantumProcessed QuantumProcessed

Notifies that the audio graph has processed the specified quantum.

QuantumStarted QuantumStarted QuantumStarted QuantumStarted QuantumStarted

Notifies that the audio graph has started processing a new quantum.

UnrecoverableErrorOccurred UnrecoverableErrorOccurred UnrecoverableErrorOccurred UnrecoverableErrorOccurred UnrecoverableErrorOccurred

Notifies of an unrecoverable audio error in audio graph operation.

See also