Dela via


AudioPlaybackConnection.TryCreateFromId(String) Method

Definition

Attempts to create an AudioPlaybackConnection from the specified device ID.

public:
 static AudioPlaybackConnection ^ TryCreateFromId(Platform::String ^ id);
 static AudioPlaybackConnection TryCreateFromId(winrt::hstring const& id);
public static AudioPlaybackConnection TryCreateFromId(string id);
function tryCreateFromId(id)
Public Shared Function TryCreateFromId (id As String) As AudioPlaybackConnection

Parameters

id
String

Platform::String

winrt::hstring

The identifier for the device for which the connection should be created.

Returns

If successful, returns an AudioPlaybackConnection. If the specified device does not have support for audio streaming, the return value is null.

Remarks

Get a device ID by creating a DeviceWatcher by calling DeviceInformation.CreateWatcher and passing in the string returned by GetDeviceSelector.

Applies to

See also