AudioPlaybackConnection Class

Definition

Represents a connection that allows a remote device to stream audio to a Windows device.

public ref class AudioPlaybackConnection sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 655360)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AudioPlaybackConnection final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 655360)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AudioPlaybackConnection : System.IDisposable
Public NotInheritable Class AudioPlaybackConnection
Implements IDisposable
Inheritance
AudioPlaybackConnection
Attributes
Implements

Windows requirements

Device family
Windows 10, version 2004 (introduced in 10.0.19041.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v10.0)

Properties

DeviceId

Gets the unique device ID for the underlying device represented by the AudioPlaybackConnection.

State

Gets the current connection state of the AudioPlaybackConnection.

Methods

Close()

Closes the connection represented by the AudioPlaybackConnection object.

Dispose()

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

GetDeviceSelector()

Gets an Advanced Query Syntax (AQS) string for that can be used to find devices for which an AudioPlaybackConnection can be created.

Open()

Attempts to connect the underlying device. If successful, this causes any audio that is playing on the remote device to be heard on the local device.

OpenAsync()

Asynchronously attempts to connect the underlying device. If successful, this causes any audio that is playing on the remote device to be heard on the local device.

Start()

Configures the system to allow connections from the remote audio source.

StartAsync()

Asynchronously configures the system to allow connections from the remote audio source.

TryCreateFromId(String)

Attempts to create an AudioPlaybackConnection from the specified device ID.

Events

StateChanged

Occurs when the connection state of the AudioPlaybackConnection changes.

Applies to