Skip to content

Commit 3c0531b

Browse files
committed
Fixing malformed snippet tags
1 parent bfbf1cc commit 3c0531b

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

hub/apps/develop/media-playback/enable-remote-audio-playback.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ The [DeviceWatcher.Added](/uwp/api/windows.devices.enumeration.devicewatcher.add
2929

3030
Call [DeviceWatcher.Start](/uwp/api/windows.devices.enumeration.devicewatcher.start) to begin watching for connected devices that support audio playback connections. In this example we will start the device manager when the main **Grid** control in the UI is loaded. For more information on using **DeviceWatcher**, see [Enumerate Devices](../devices-sensors/enumerate-devices.md).
3131

32-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_MainGridLoaded":::
32+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_MainGridLoaded":::
3333

3434

3535
In the device watcher's **Added** event, each discovered device is represented by a [DeviceInformation](/uwp/api/Windows.Devices.Enumeration.DeviceInformation) object. Add each discovered device to an observable collection that is bound to the **ListView** control in the UI.
3636

37-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_DeclareDevices":::
37+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeclareDevices":::
3838

3939

40-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_DeviceWatcher_Added":::
40+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeviceWatcher_Added":::
4141

4242

4343
## Enable and release audio playback connections
@@ -48,33 +48,33 @@ In the click handler for the **Enable Audio Playback Connection** button, get th
4848

4949
If the connection is successfully created, add the new **AudioPlaybackConnection** object to the app's dictionary, register a handler for the object's [StateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event, and call [StartAsync](/uwp/api/windows.media.audio.audioplaybackconnection.startasync) to notify the system that the new connection is enabled.
5050

51-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_DeclareConnections":::
51+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeclareConnections":::
5252

53-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_EnableAudioPlaybackConnection":::
53+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_EnableAudioPlaybackConnection":::
5454

5555

5656
## Open the audio playback connection
5757

5858
In the previous step, an audio playback connection was created, but sound does not begin playing until the connection is opened by calling [Open](/uwp/api/windows.media.audio.audioplaybackconnection.open) or [OpenAsync](/uwp/api/windows.media.audio.audioplaybackconnection.openasync). In the **Open Audio Playback Connection** button click handler, get the currently selected device and use the ID to retrieve the **AudioPlaybackConnection** from the app's dictionary of connections. Await a call to **OpenAsync** and check the **Status** value of the returned [AudioPlaybackConnectionOpenResultStatus](/uwp/api/windows.media.audio.audioplaybackconnectionopenresult) object to see if the connection was opened successfully and, if so, update the connection state text box.
5959

6060

61-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_OpenAudioPlaybackConnectionButton":::
61+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_OpenAudioPlaybackConnectionButton":::
6262

6363
## Monitor audio playback connection state
6464

6565
The [AudioPlaybackConnection.ConnectionStateChanged](/uwp/api/windows.media.audio.audioplaybackconnection.statechanged) event is raised whenever the state of the connection changes. In this example, the handler for this event updates the status text box. Remember to update the UI inside a call to [DispatcherQueue.TryEnqueue](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueue.tryenqueue) to make sure the update is made on the UI thread.
6666

67-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_ConnectionStateChanged":::
67+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_ConnectionStateChanged":::
6868

6969
## Release connections and handle removed devices
7070

7171
This example provides a **Release Audio Playback Connection** button to allow the user to release an audio playback connection. In the handler for this event, we get the currently selected device and use the device's ID to look up the **AudioPlaybackConnection** in the dictionary. Call **Dispose** to release the reference and free any associated resources and remove the connection from the dictionary.
7272

73-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_ReleaseAudioPlaybackConnectionButton":::
73+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_ReleaseAudioPlaybackConnectionButton":::
7474

7575
You should handle the case where a device is removed while a connection is enabled or open. To do this, implement a handler for the device watcher's [DeviceWatcher.Removed](/uwp/api/windows.devices.enumeration.devicewatcher.removed) event. First, the ID of the removed device is used to remove the device from the observable collection bound to the app's **ListView** control. Next, if a connection associated with this device is in the app's dictionary, **Dispose** is called to free the associated resources and then the connection is removed from the dictionary. All of this is done within a call to **DispatcherQueue.TryEnqueue** to make sure the UI updates are performed on the UI thread.
7676

77-
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs.cs" id="snippet_DeviceWatcher_Removed":::
77+
:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/audio-playback-connection/cs/AudioPlaybackConnectionExample/MainWindow.xaml.cs" id="snippet_DeviceWatcher_Removed":::
7878

7979
## Related topics
8080

0 commit comments

Comments
 (0)