<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Media Foundation and DirectShow tips, gotchas and code bits</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mediasdkstuff/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/feed.xml</link>
    <description>This blog is dedicated to assisting fellow Software Engineers who are integrating Microsoft’s audio and video technologies into their software.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:50:04 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>List of Windows 10 (developer preview) UWP Audio, Video, Camera and Graphics samples</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/list-of-windows-10-developer-preview-uwp-audio-video-camera-and-graphics-samples</link>
      <pubDate>Fri, 29 May 2015 17:02:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2015/05/29/list-of-windows-10-developer-preview-uwp-audio-video-camera-and-graphics-samples/</guid>
      <description><![CDATA[[Update: Fixed broken links]
Hello again my fellow media development&nbsp;enthusiasts. It is that...]]></description>
      <content:encoded><![CDATA[<p>[Update: Fixed broken links]</p>
<p>Hello again my fellow media development&nbsp;enthusiasts. It is that time once again. Windows 10 UWP apps are more media capable than ever before. My previous lists of Media centric samples for Windows 8 &amp; 8.1&nbsp;were popular and hopefully helpful&nbsp;so I wanted to make sure to continue the tradition. In this edition I've also included samples for&nbsp;some of the new D2D technologies that can interoperate with the Media stack. While this list may not be extensive hopefully it is as least close. If you find any other samples that I&rsquo;ve missed please let me know.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="111">
<p align="center">Category</p>
</td>
<td width="148">
<p align="center">Sample</p>
</td>
<td valign="top" width="365">
<p align="center">Description</p>
</td>
</tr>
<tr>
<td rowspan="5" width="111">
<p align="center">Playback</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/AdaptiveStreaming">Adaptive<br />&nbsp; Streaming</a></p>
</td>
<td valign="top" width="365">
<p>How to create and use an AdaptiveMediaSource to playback HLS and DASH content over HTTP.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BackgroundAudio">Background<br />&nbsp; Audio</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to use the Background Media Player and playback lists to create a collection of songs that can continue to play even when the app is no longer in the foreground.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/SystemMediaTransportControls">System<br />&nbsp; Media Transport Controls</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrate how to register and handle media transport events for hardware and software buttons using the&nbsp; <a href="http://msdn.microsoft.com/library/windows/apps/dn278677"><strong>SystemMediaTransportControls</strong></a> .</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/VideoPlayback">Video<br />&nbsp; Playback</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to create apps that take advantage of many media platform features.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/XamlCustomMediaTransportControls">Custom<br />&nbsp; Media Transport Controls</a></p>
</td>
<td valign="top" width="365">
<p>This sample shows how to create customized media transport controls for the Media Element in your XAML Windows App.</p>
</td>
</tr>
<tr>
<td rowspan="3" width="111">
<p align="center">Create &amp; Edit</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/AudioCreation">Audio<br />&nbsp; Creation</a></p>
</td>
<td valign="top" width="365">
<p>This sample shows&nbsp;how to use the APIs in the <strong>Windows.Media.Audio</strong> namespace to create audio graphs for audio routing, mixing, and processing scenarios.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/MediaEditing">Media<br />&nbsp; Editing</a></p>
</td>
<td valign="top" width="365">
<p>&nbsp;</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraGetPreviewFrame">GetPreviewFrame</a></p>
</td>
<td valign="top" width="365">
<p>This sample applies an end-to-end approach to demonstrate how to write a camera application using the Windows.Media.Capture API in conjunction with the DisplayInformation API to acquire preview frames from the camera stream for further processing.</p>
</td>
</tr>
<tr>
<td rowspan="2" width="111">
<p align="center">Media Casting</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BasicMediaCasting">Basic<br />&nbsp; Media Casting</a></p>
</td>
<td valign="top" width="365">
<p>Demonstrates how to send a piece of media content from one device to another. Exercises the Windows.Media.Casting API set.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/AdvancedCasting">Screen<br />&nbsp; Casting</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to combine different casting technologies into a single user experience.</p>
</td>
</tr>
<tr>
<td rowspan="2" width="111">
<p align="center">Camera</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraProfile">Camera<br />&nbsp; Profile</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates a new extension to Windows.Media.Capture.MediaCaptureInitializationSettings API.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraStarterKit">Universal<br />&nbsp; Camera</a></p>
</td>
<td valign="top" width="365">
<p>This sample applies an end-to-end approach to demonstrate how to write a camera application using the Windows.Media.Capture API in conjunction with orientation sensors to cover the functions that most camera apps will require.</p>
</td>
</tr>
<tr>
<td rowspan="3" width="111">
<p align="center">Graphics &amp; Effects</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/compositionvisual">Composition<br />&nbsp; Visual</a></p>
</td>
<td valign="top" width="365">
<p>The sample shows how to construct and walk a simple tree of Visuals to change opacity without using any XAML, WWA, or DirectX.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/D2DCustomEffects">Direct2D<br />&nbsp; Custom Effects</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to implement <a href="http://msdn.microsoft.com/library/windows/desktop/jj710194">custom Direct2D effects</a> using HLSL pixel, vertex, and compute shaders.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/D2DGradientMesh">Direct2D<br />&nbsp; Gradient Mesh</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to instantiate and render a gradient mesh in <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd370990">Direct2D</a>.</p>
</td>
</tr>
<tr>
<td rowspan="3" width="111">
<p align="center">Misc.</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CameraFaceDetection">Face<br />&nbsp; Detection</a></p>
</td>
<td valign="top" width="365">
<p>This sample applies an end-to-end approach to demonstrate how to write a camera application using the Windows.Media.Capture API in conjunction with orientation sensors to cover the functions that most camera apps will require.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FileThumbnails">File<br />&nbsp; and Folder Thumbnail</a></p>
</td>
<td valign="top" width="365">
<p>This sample shows how to retrieve thumbnails for files and folders. It uses <a href="http://msdn.microsoft.com/library/windows/apps/br207831"><strong>Windows.Storage.FileProperties</strong></a>.</p>
</td>
</tr>
<tr>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/LibraryManagement">Library<br />&nbsp; Management</a></p>
</td>
<td valign="top" width="365">
<p>Demonstrates how to get a list of the folders in a user's library and how to let users add and remove folders from that list. This samples uses <a href="http://msdn.microsoft.com/library/windows/apps/br227346"><strong>Windows.Storage</strong></a>.<a href="http://msdn.microsoft.com/library/windows/apps/dn251722"><strong>StorageLibrary</strong></a>.</p>
</td>
</tr>
<tr>
<td width="111">
<p align="center">Music Device Control</p>
</td>
<td width="148">
<p align="center"><a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/MIDI">MIDI</a></p>
</td>
<td valign="top" width="365">
<p>This sample demonstrates how to use the Windows.Devices.Midi API in a Windows Runtime app.</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>BackgroundMediaPlayer architecture on Windows Phone 8.1</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/backgroundmediaplayer-architecture-on-windows-phone-8-1</link>
      <pubDate>Thu, 25 Dec 2014 17:05:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2014/12/25/backgroundmediaplayer-architecture-on-windows-phone-8-1/</guid>
      <description><![CDATA[I posted this a while back on the MSDN Windows Phone Development forum. I think that it includes...]]></description>
      <content:encoded><![CDATA[<p>I posted this a while back on the MSDN Windows Phone Development forum. I think that it includes some really great information and I wanted to make sure to isolate and include it here for discoverability. The original thread can be found <a href="https://social.msdn.microsoft.com/Forums/windowsapps/en-US/7d312fc9-99ca-479d-b5ff-3c746c81091b/media-foundation-transforms-for-backgroundmediaplayer?forum=wpdevelop">here</a> for additional context.</p>
<p>Okay, let&rsquo;s talk about the BackgroundMediaPlayer architecture a bit. Windows Phone 8 (WP8) was a three process architecture. Windows Phone 8.1 (WP8.1) is a two process architecture. I won&rsquo;t go into how WP8 works. In WP8.1 you have a UI process and a background player process. The background player process is registered as a singleton instance OOPServer. This means that the background player will only be created if one does not already exist in the current app container.</p>
<p>The background player process contains your background audio code. Just like Windows 8 this process is given a PLM exemption that allows it to continue to run in the background while your UI process can be suspended. Once the exemption is registered, management of the background player process is handed off to the media manger. The media manager coordinates closely with the PLM to ensure there is only one active background player process at a given time. This means only one app can be playing audio in the background at any time.</p>
<p>-James</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Capturing raw PCM audio on Windows Phone 8 and 8.1</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/capturing-raw-pcm-audio-on-windows-phone-8-and-8-1</link>
      <pubDate>Fri, 03 Oct 2014 16:04:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2014/10/03/capturing-raw-pcm-audio-on-windows-phone-8-and-8-1/</guid>
      <description><![CDATA[[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The original post can be found <a href="http://blogs.msdn.com/b/wsdevsol/archive/2014/10/31/capturing-raw-pcm-audio-on-windows-phone-8-and-8-1.aspx">here</a>.]</span></p>
<p>There are a number of different audio capture and playback APIs on Windows Phone 8.x. Unfortunately If you want to get at the raw PCM data and process it in near real time your options are limited. While it is possible to capture raw PCM audio from managed code it is not recommended and likely will not work for high performance audio apps. Audio capture in managed code is very prone to dropouts. While using a sizeable buffer may allow for a reasonable solution it is still not recommended. For more information about why this is a bad idea please see my blog.</p>
<p>Because of the problems inherent with capturing audio from managed code it is recommended to use a pure unmanaged C++ solution. Specifically the Windows Audio Session API (WASAPI) implemented via COM. WASAPI is a very low level and highly performant audio playback and recording API. As of Windows Phone 8.1 audio latencies tend to be in the 50 ms &ndash; 100 ms range round trip. Lower latencies may be possible at the risk of audio dropouts. Latency tends to be very hardware / driver dependent. Implementing a WASAPI solution does require some basic knowledge of COM and extensive knowledge of C / C++.</p>
<p>It is possible to implement the necessary WASAPI functionality in a C++ / COM solution and package it in a standard runtime DLL for consumption by higher level managed languages. This is sometimes called a hybrid solution. There are some implementation details with a hybrid solution to be aware of. You should avoid creating an interface that transports the raw audio data from the C++ library to the unmanaged parent. Streaming audio can create a lot of data. Crossing the managed to unmanaged boundary frequently with large amounts of data can cause performance and memory pressure issues. While these issues can be managed we currently recommend that you encapsulate all of the audio capture, decoding and encoding functionality into the C++ library. You can then implement &ldquo;light&rdquo;, i.e. simple interfaces that are not called frequently to manage the functionality of the library from managed code.</p>
<p>There are some distinct limitations inherent in the WASAPI. Most notably WASAPI&rsquo;s sample rate (record and playback) is locked to the default rate and bitness of the mixing engine (exclusive mode is not supported on the phone platform). There is no way to change the default sample rate programmatically. On most devices this rate will be locked to either 44.1 kHz or 48 kHz and the bitness will be either 16 or 32. This is usually acceptable for most applications but can cause problems with specialty applications that require a certain frequency.</p>
<p>To add to the complexity of this limitation WASAPI does not support sample rate conversion. This means that if your particular application requires audio data at a certain sample rate you will need to provide your own converter. At this time Microsoft does not provide an easy to use sample rate conversion API or component. While sample rate conversation is relatively simple to implement it can be computationally expensive and should be avoided if possible.</p>
<p>Here are some links that should help you get started with the WASAPI on Windows Phone 8.x:</p>
<p>Audio Capture and Render APIs for native code for Windows Phone<br /><a href="http://msdn.microsoft.com/en-us/library/windows/apps/jj715884(v=vs.105).aspx">http://msdn.microsoft.com/en-us/library/windows/apps/jj715884(v=vs.105).aspx</a></p>
<p>ActivateAudioInterface<br /><a href="http://msdn.microsoft.com/en-us/library/windows/apps/jj731089(v=vs.105).aspx">http://msdn.microsoft.com/en-us/library/windows/apps/jj731089(v=vs.105).aspx</a></p>
<p>IAudioRenderClient interface<br /><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd368242(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd368242(v=vs.85).aspx</a></p>
<p>IAudioCaptureClient interface<br /><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd370858(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd370858(v=vs.85).aspx</a></p>
<p>-James</p>]]></content:encoded>
    </item>
    <item>
      <title>Achievement Unlocked: MIDI support added to Windows 8.1 apps</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/achievement-unlocked-midi-support-added-to-windows-8-1-apps</link>
      <pubDate>Fri, 05 Sep 2014 17:29:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2014/09/05/achievement-unlocked-midi-support-added-to-windows-8-1-apps/</guid>
      <description><![CDATA[[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">[This is a copy of the blog post I originally wrote and published on behalf of the WSDS team. The original post can be found here:</span><span style="font-size: small;">&nbsp;</span><span><a href="https://aka.ms/Img05f">aka.ms/Img05f</a>]</span></p>
<p><span style="font-size: small;">Since the release of Windows 8 Developer Preview I have been pushing our Multimedia group to add MIDI support for Windows Store apps. On April 4th, 2014 I achieved victory. This year at //build we announced the preview release of the Musical Instrument Digital Interface (MIDI) APIs for Windows Store apps. With this announcement you can now create Windows Store apps that can interface with the veritable plethora of MIDI keyboards, synthesizers and mixers that have shipped over the last three decades. That&rsquo;s right you can now add a touch first XAML interface to your Roland JP-6 via any Windows 8.1 device! This means that musicians, audio engineers, DJs and lighting designers can be empowered to create unique experiences with your software while leveraging the full range of Microsoft Windows 8.1 devices.</span></p>
<p><span style="font-size: small;">The new MIDI APIs are not simple wrappers around the classic Win32 MIDI APIs. These new APIs have been built from the ground up. Our intent here is to create a consistent and extensible platform for the future of MIDI app development. We have focused on simplicity and ease of use. We parse the MIDI data for you and offer it up using the standard WinRT object oriented architecture. We hope that this will allow any WinRT programmer to leverage their existing knowledge to quickly come up to speed on these new APIs. That said we haven&rsquo;t forgotten about all that custom MIDI parsing code you&rsquo;ve been using in your apps since the dawn of MIDI. We also make the raw data available to you to party on as you see fit.</span></p>
<p><span style="font-size: small;">There are a number of things to consider before writing a new MIDI enabled app or adding MIDI support to an existing app. First and foremost the new MIDI APIs are still in preview (as of this writing). This is why you see &ldquo;WindowsPreview&rdquo; as the namespace prefix rather than &ldquo;Windows&rdquo;. Because these APIs are still in preview there is a chance that they may change when the final version is released. That said the current preview version of these APIs comes with a &ldquo;go live&rdquo; license. In essence we believe that these new APIs are solid and stable enough to enable you to use them in your apps right now. We will almost certainly tweak the APIs based on your feedback, so you may need to mod your app when the final version is released. That said we will continue to support the preview APIs for existing apps until such time that a vast majority of apps have migrated to the final release. So rest assured the MIDI preview APIs are ready to rock.</span></p>
<p><span style="font-size: small;">There are a few other &ldquo;gotchas&rdquo; when developing apps using the new MIDI APIs:</span></p>
<ol>
<li><span style="font-size: small;">Due to some technical strangeness you need to make sure to build your app for the platform that you are on. Using &ldquo;Any CPU&rdquo; is not going to work. What this means is that if you have a 64 bit installation of Windows you need to change your build configuration to target x64. Typically you can target x86 on an x64 system and be just fine thanks to &ldquo;Windows on Windows&rdquo;. Unfortunately with these new MIDI APIs you need to make sure to target the exact version of the OS. This means x64 on x64, x86 on x86 and of course ARM on ARM. Because of this you are going to need to provide an x86, x64 and ARM version of your app when submitting to the store. Hopefully this will change with the final release.</span></li>
<li><span style="font-size: small;">The new MIDI APIs only work on Windows 8.1. So you need to make sure you are using Visual Studio 2013 and target Windows 8.1. This really shouldn&rsquo;t be much of an issue as the migration from Windows 8 to Windows 8.1 is seamless and easy.</span></li>
<li><span style="font-size: small;">You also need to make sure to download the new APIs via NuGet. Visual Studio 2013&rsquo;s NuGet package manager (under the &ldquo;project&rdquo; menu) allows you to easily download the APIs and automatically add a reference to your project. That's right, for the first time we've made new APIs available via NuGet! Cool huh.</span></li>
</ol>
<p><span style="font-size: small;">I hope you are as excited about the advent MIDI support in WinRT as I am. I can&rsquo;t wait to see the new and innovative MIDI apps you add to the store. </span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Resources:</span></p>
<p><a href="http://msdn.microsoft.com/en-us/library/windows/apps/dn643522.aspx">Windows Preview API</a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/MIDI-Windows-Runtime-sample-4fd6dcbc">MIDI Windows Runtime sample</a></p>
<p>NuGet: <a href="https://www.nuget.org/packages/Microsoft.WindowsPreview.MidiRT/1.0.0">Windows Runtime API for MIDI Preview 1.0.0</a></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">-James</span>&nbsp;</p>
<p><span style="font-size: small;">"Music is a higher revelation than all wisdom and philosophy." ~ Ludwig von Beethoven</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Using MediaComposition to add background audio to video (Windows Phone 8.1)</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/using-mediacomposition-to-add-background-audio-to-video-windows-phone-8-1</link>
      <pubDate>Wed, 18 Jun 2014 15:40:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2014/06/18/using-mediacomposition-to-add-background-audio-to-video-windows-phone-8-1/</guid>
      <description><![CDATA[One of our friends on the forum pointed out that we really don&rsquo;t have any good samples on how...]]></description>
      <content:encoded><![CDATA[<p>One of our friends on the forum pointed out that we really don&rsquo;t have any good samples on how to use the MediaComposition. Hopefully we will remedy this soon. To help you get your feet wet with this cool new technology added to Windows Phone 8.1 here is some really basic sample code. Enjoy!</p>
<pre style="background: #1e1e1e; color: gainsboro; font-family: Consolas;"><span style="color: #57a64a;">//&nbsp;Load&nbsp;video&nbsp;file</span>
<span style="color: #569cd6;">var</span>&nbsp;uri&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">new</span>&nbsp;<span style="color: #4ec9b0;">Uri</span>(<span style="color: #d69d85;">"ms-appx:///Assets/bear.mp4"</span>);
<span style="color: #569cd6;">var</span>&nbsp;vid&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">await</span>&nbsp;<span style="color: #4ec9b0;">StorageFile</span><span style="color: #b4b4b4;">.</span>GetFileFromApplicationUriAsync(uri);
 
<span style="color: #57a64a;">//&nbsp;Load&nbsp;audio&nbsp;file</span>
uri&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">new</span>&nbsp;<span style="color: #4ec9b0;">Uri</span>(<span style="color: #d69d85;">"ms-appx:///Assets/song.mp3"</span>);
<span style="color: #569cd6;">var</span>&nbsp;aud&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">await</span>&nbsp;<span style="color: #4ec9b0;">StorageFile</span><span style="color: #b4b4b4;">.</span>GetFileFromApplicationUriAsync(uri);
 
<span style="color: #57a64a;">//&nbsp;Create&nbsp;our&nbsp;output&nbsp;file</span>
<span style="color: #4ec9b0;">StorageFolder</span>&nbsp;storageFolder&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #4ec9b0;">KnownFolders</span><span style="color: #b4b4b4;">.</span>VideosLibrary;
<span style="color: #569cd6;">var</span>&nbsp;file&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">await</span>&nbsp;storageFolder<span style="color: #b4b4b4;">.</span>CreateFileAsync(<span style="color: #d69d85;">"out.mp4"</span>,&nbsp;<span style="color: #b8d7a3;">CreationCollisionOption</span><span style="color: #b4b4b4;">.</span>ReplaceExisting);
 
<span style="color: #57a64a;">//&nbsp;Create&nbsp;our&nbsp;editor</span>
<span style="color: #4ec9b0;">MediaComposition</span>&nbsp;mc&nbsp;<span style="color: #b4b4b4;">=</span>&nbsp;<span style="color: #569cd6;">new</span>&nbsp;<span style="color: #4ec9b0;">MediaComposition</span>();
 
<span style="color: #57a64a;">//&nbsp;Add&nbsp;our&nbsp;audio&nbsp;and&nbsp;backgropund&nbsp;audio&nbsp;track</span>
mc<span style="color: #b4b4b4;">.</span>Clips<span style="color: #b4b4b4;">.</span>Add(<span style="color: #569cd6;">await</span>&nbsp;<span style="color: #4ec9b0;">MediaClip</span><span style="color: #b4b4b4;">.</span>CreateFromFileAsync(vid));
mc<span style="color: #b4b4b4;">.</span>BackgroundAudioTracks<span style="color: #b4b4b4;">.</span>Add(<span style="color: #569cd6;">await</span>&nbsp;<span style="color: #4ec9b0;">BackgroundAudioTrack</span><span style="color: #b4b4b4;">.</span>CreateFromFileAsync(aud));
 
<span style="color: #57a64a;">//&nbsp;Generate&nbsp;the&nbsp;edited&nbsp;file</span>
<span style="color: #569cd6;">await</span>&nbsp;mc<span style="color: #b4b4b4;">.</span>RenderToFileAsync(file);</pre>
<p>Note: Audio and video assets have been removed from attached project files.</p>
<p>MediaComposition</p>
<p><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.media.editing.mediacomposition.aspx">http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.media.editing.mediacomposition.aspx</a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/53/55/37/MediaCompositionBackgroundAudio.zip" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-53-55-37/MediaCompositionBackgroundAudio.zip">MediaCompositionBackgroundAudio.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Free Chalk Talk: Light up Your Apps with Sights and Sounds</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/free-chalk-talk-light-up-your-apps-with-sights-and-sounds</link>
      <pubDate>Wed, 02 Oct 2013 17:43:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2013/10/02/free-chalk-talk-light-up-your-apps-with-sights-and-sounds/</guid>
      <description><![CDATA[Hello All,
I am giving a live chalk talk on October 16th for interested English speaking engineers....]]></description>
      <content:encoded><![CDATA[<p>Hello All,</p>
<p>I am giving a live chalk talk on October 16th for interested English speaking engineers. Anyone can sign up and join the talk for free!</p>
<p>If you or someone you know would benefit from a discussion about integrating audio and video technologies into your apps please join me. All audio and video questions will be answered. Nothing is taboo :)</p>
<p>This is your rare opportunity to pick the brain of a self-described Microsoft media uber-nerd (me).</p>
<p>Space is limited so sign up using this link TODAY!<br /><a href="https://aka.ms/Jdk7j0">https://aka.ms/Jdk7j0</a></p>
<p>------------------------------------------------</p>
<p>Chalk Talk for Developers: Light up Your Apps with Sights and Sounds</p>
<p>&ldquo;The sound and music are 50% of the entertainment&hellip;&rdquo; &ndash; George Lucas</p>
<p>In this talk we will take you on a tour of the amazing APIs available to enable you to light up your apps with sound and video. From playing a simple video cut scene to adding rich music and sound effects to your next great game, this highly technical talk will cover it all. After the tour we will allow you, the participant, to guide the discussion. What do you want to know about sound and video on the Windows Store app platform that will allow you to take your app to the next level?</p>
<p>Please join us on Wednesday October 16th, 2013 from 11am-1pm PST.&nbsp; We&rsquo;ll be hosting a live chalk talk with technical experts from our developer support team.</p>
<p>We&rsquo;ll look at demos of real-world scenarios, how the technology works, best practices for implementation, and development troubleshooting tips. There will also be plenty of time for you to ask your questions.</p>
<p>If you are interested, sign up today as space is limited.</p>
<p>WHAT: Light up Your Apps with Sights and Sounds</p>
<p>WHEN: October 16th, 2013 11am-1pm PST</p>
<p>WHERE: Online Meeting</p>
<p>REGISTRATION: email <a href="mailto:Wsdsctreg@microsoft.com">Wsdsctreg@microsoft.com</a> with the subject &ldquo;October 16th Chalk Talk&rdquo;.</p>
<p>COST: Free</p>
<p>-----------------------------------------------------</p>]]></content:encoded>
    </item>
    <item>
      <title>List of Windows 8.1 preview audio / video and camera samples</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/list-of-windows-8-1-preview-audio-video-and-camera-samples</link>
      <pubDate>Thu, 27 Jun 2013 11:45:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2013/06/27/list-of-windows-8-1-preview-audio-video-and-camera-samples/</guid>
      <description><![CDATA[My fellow media development enthusiasts the awesomeness that is Windows 8.1 is upon us. My list of...]]></description>
      <content:encoded><![CDATA[<p>My fellow media development enthusiasts the awesomeness that is Windows 8.1 is upon us. My list of media specific samples for Windows 8 CP was such a hit that I thought I would do it again (and this time on day one from the hackathon at //build 2013). You&rsquo;ve stumbled upon my list of audio, video and camera samples for Windows 8.1 preview. While this list may not be extensive hopefully it is as least close. If you find any other samples that I&rsquo;ve missed please let me know.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="157">
<p>Media capture</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622">Media capture using capture device sample </a></p>
</td>
</tr>
<tr>
<td valign="top" width="157">
<p>Camera</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/CameraCaptureUI-Sample-845a53ac">CameraCaptureUI Sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Metro-style-device-app-for-4f39b7bf">Windows Store device app for camera sample </a></p>
</td>
</tr>
<tr>
<td valign="top" width="157">
<p>Media playback</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/Playback-Manager-e6526e67">Playback Manager msAudioCategory sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Playback-Manager2-55c5b86d">Playback Manager Companion Sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Buttons-ea57d8e2">Configure keys for media sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Basic-Media-Playback-003619be">XAML media playback sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Playlist-sample-3d80daee">Playlist sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Playback-Sample-3bdbe7c9">HTML media playback sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/MediaStreamSource-media-dfd55dff">MediaStreamSource streaming sample </a></p>
</td>
</tr>
<tr>
<td valign="top" width="157">
<p>Advanced Media</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-extensions-sample-7b466096">Media extensions sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Simple-Communication-Sample-eac73290">Real-time communication sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Transcode-Sample-f7ba5269">Transcoding media sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Windows-Audio-Session-22dcab6b">Windows Audio Session (WASAPI) sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Engine-Playback-ce1c82f0">Media engine native C++ video playback sample </a></p>
</td>
</tr>
<tr>
<td valign="top" width="157">
<p>Play To / DLNA</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-PlayTo-Sample-fedcb0f9">Media Play To sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/PlayToReceiver-sample-607f00ed">PlayToReceiver sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Media-Server-sample-fffbe490">Media Server client sample </a></p>
</td>
</tr>
<tr>
<td valign="top" width="157">
<p>XAudio2</p>
</td>
<td valign="top" width="481">
<p><a href="http://code.msdn.microsoft.com/windowsapps/Basic-Audio-Sample-9a5bb0b7">XAudio2 audio file playback sample </a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/XAudio2-Stream-Effect-3f95c8f2">XAudio2 audio stream effect sample </a></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Mixed Media – Audio &amp; Video – Windows Store vs. Windows Phone 8</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/mixed-media-audio-video-windows-store-vs-windows-phone-8</link>
      <pubDate>Fri, 08 Mar 2013 15:02:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2013/03/08/mixed-media-audio-video-windows-store-vs-windows-phone-8/</guid>
      <description><![CDATA[Please note: This post is "reprinted" from the "Managing Windows Store Developer Solutions"...]]></description>
      <content:encoded><![CDATA[<div class="WordSection1">
<p><span style="font-size: small;">Please note: This post is "reprinted" from the "Managing Windows Store Developer Solutions" blog&nbsp;with permission from the author (just so happens to be me).&nbsp;</span></p>
<p><span style="font-size: small;">Original post found here:</span></p>
<p><span style="font-size: small;"><a href="http://blogs.msdn.com/b/wsdevsol/archive/2013/03/08/mixed-media-audio-amp-video-windows-store-vs-windows-phone-8.aspx">http://blogs.msdn.com/b/wsdevsol/archive/2013/03/08/mixed-media-audio-amp-video-windows-store-vs-windows-phone-8.aspx</a></span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">As everyone knows, with the release of Windows 8 and Windows Phone 8 we have brought the two platforms closer together than ever before. The keyword here is &ldquo;closer&rdquo;. There are still some fairly major implementation and terminology differences between the two platforms particularly when working with digital audio and video. Hopefully this article will help you map and understand the media technologies between the two platforms. In this article I&rsquo;m assuming that you are familiar with the media technologies on one platform or the other and just need some hints how to migrate your code to the other platform.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: xx-large;">Audio / Video Playback Technologies</span></p>
<p>&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="2" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">Audio / Video Playback &ndash; Technology Map</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8</h3>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">MediaElement (XAML)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">MediaElement (XAML)</span></p>
</td>
</tr>
<tr>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">IMFMediaEngine (C++ only)</span></p>
</td>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">IMFMediaEngine (C++ only) (Subset)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">WASAPI (C++ only)</span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">WASAPI (C++ only) (Subset)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">XAudio2 (C++ only)</span></p>
</td>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">XAudio2 (C++ only)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">The MediaElement will likely be your &ldquo;go to&rdquo; control on both platforms for playing audio and video. There are a few differences though. You can&rsquo;t add audio or video effects (plug-ins) to the MediaElement on the phone. The DRM implementation is also quite different between the two platforms. If you are not doing anything &ldquo;fancy&rdquo; you should be able to port your MediaElement implementation with no problem.</span></p>
<p><br /><span style="font-size: small;">The MediaEngine (different from the MediaElement discussed above) is new for both platforms in version 8. On both platforms the MediaEngine can only be used from C++ and is not currently supported from managed code. The phone also has slightly reduced functionality. On the phone the MediaEngine only supports frame-server mode. Also keep in mind that on the phone hardware acceleration will always be used.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">WASAPI and XAudio2 are also supported on both platforms. Unfortunately at this time these audio only technologies can only be called from C++. They are not currently supported from managed code. While the full XAudio2 functionality is supported on both platforms keep in mind that XAudio2 only supports uncompressed PCM audio on the phone. It is extremely difficult to use XAudio2 with compressed media formats on the phone at this time. The phone also only supports a subset of the WASAPI Core Audio APIs as well.</span></p>
<p>&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="4" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">References</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt;" colspan="2" valign="top" width="282">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store app</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt;" colspan="2" valign="top" width="342">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8 app</h3>
</td>
</tr>
<tr style="height: 32.8pt;">
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt; height: 32.8pt;" colspan="2" valign="top" width="282">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh452756.aspx">Win32 and COM for Windows Store apps (multimedia)</a></span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt; height: 32.8pt;" colspan="2" valign="top" width="342">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206944(v=vs.105).aspx">Native audio APIs for Windows Phone 8</a>&nbsp;</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr style="height: 32.8pt;">
<td style="padding: 0in 5.4pt; border: 1pt solid windowtext; width: 211.25pt; height: 32.8pt;" colspan="2" valign="top" width="282">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh447918(v=vs.85).aspx">IMFMediaEngine interface (Windows)</a></span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt; height: 32.8pt;" colspan="2" valign="top" width="342">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681688(v=vs.105).aspx">Supported Microsoft Media Foundation APIs for Windows Phone 8</a></span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr style="height: 32.8pt;">
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt; height: 32.8pt;" colspan="2" valign="top" width="282">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.mediaelement.aspx">MediaElement class (Windows)</a></span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt; height: 32.8pt;" colspan="2" valign="top" width="342">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.controls.mediaelement(v=vs.105).aspx">MediaElement Class</a></span></p>
</td>
</tr>
<tr>
<td style="border: currentColor;" width="0">&nbsp;</td>
<td style="border: currentColor;" width="281">&nbsp;</td>
<td style="border: currentColor;" width="0">&nbsp;</td>
<td style="border: currentColor;" width="341">&nbsp;</td>
<td style="border: currentColor;" width="0">&nbsp;</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: xx-large;">Background Audio</span></p>
<p>&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="2" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">Background Audio &ndash; Technology Map</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store (XAML / HTML5)</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8 (XAML)</h3>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">MediaElement / Audio tag</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">BackgroundAudioPlayer</span></p>
</td>
</tr>
<tr>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">msAudioCategory="BackgroundCapableMedia"</span></p>
</td>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">AudioPlayerAgent</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">Windows.Media.MediaControl</span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">Universal Volume Control (UVC)</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
<tr>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">Media Foundation Source (C++ only)</span></p>
</td>
<td style="background: #e7e6e6; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">MediaStreamSource</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">The big difference playing background audio in a Windows Store app vs. Windows Phone 8 app is the use of the BackgroundAudioPlayer on the Phone and the MediaElement / Audio tag for Windows Store apps. The BackgroundAudioPlayer is a static class that can be used without needing instantiation. The MediaElement and Audio tags must be defined in markup before they can be used.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">For your Windows Store app you must set MsAudioCategory=&rdquo;BackgroundCapableMedia&rdquo;. For your phone app you need to create an AudioPlayerAgent that will run in the background when your app gets swapped out.&nbsp;&nbsp;</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">The final thing to note is that on both platforms you need to handle user input from the lock screen media controls. On the phone we call these controls the &ldquo;Universal Volume Control&rdquo; (UVC) and in your Store app we call them the &ldquo;media controls&rdquo;. Different terms but the same basic functionality.</span></p>
<p>&nbsp;<br />&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="2" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">References</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt;" valign="top" width="282">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store app</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt;" valign="top" width="342">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8 app</h3>
</td>
</tr>
<tr style="height: 32.8pt;">
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt; height: 32.8pt;" valign="top" width="282">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windows/apps/Hh700367.aspx">How to play audio in the background (Windows Store apps using JavaScript and HTML)</a></span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt; height: 32.8pt;" valign="top" width="342">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394039(v=vs.105).aspx">Background audio overview for Windows Phone</a></span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: xx-large;">Sharing Media</span></p>
<p>&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="2" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">Sharing Media &ndash; Technology Map</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store (XAML / HTML5)</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8 (XAML)</h3>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">DataTransferManager class</span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 233.75pt;" valign="top" width="312">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;">ShareMediaTask Class</span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">The big difference here is that with Windows Store apps the user initiates the sharing process using the &ldquo;share charm&rdquo;. On the phone your app will need to invoke the ShareMediaTask directly from within your code.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">In both cases you will likely never get confirmation that your data was successfully shared. In essence it&rsquo;s a &ldquo;fire and forget&rdquo; operation.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Keep in mind that on the phone your app will be swapped out and may get shut down when the app you are sharing with takes up the full screen. Because of this you may need to save state.</span></p>
<p>&nbsp;</p>
<table style="border: currentColor; border-collapse: collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="background: #d0cece; padding: 0in 5.4pt; border: 1pt solid windowtext; width: 467.5pt;" colspan="2" valign="top" width="623">
<h2 style="text-align: center; line-height: normal;" align="center">References</h2>
</td>
</tr>
<tr>
<td style="background: #d5dce4; border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt;" valign="top" width="282">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Store app</h3>
</td>
<td style="background: #d5dce4; border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt;" valign="top" width="342">
<h3 style="text-align: center; line-height: normal;" align="center">Windows Phone 8 app</h3>
</td>
</tr>
<tr>
<td style="border-width: medium 1pt 1pt; border-style: none solid solid; border-color: currentColor windowtext windowtext; padding: 0in 5.4pt; width: 211.25pt;" valign="top" width="282">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windows/apps/Hh758314.aspx">Sharing and receiving content (Windows Store apps using JavaScript and HTML) (Windows)</a></span></p>
</td>
<td style="border-width: medium 1pt 1pt medium; border-style: none solid solid none; border-color: currentColor windowtext windowtext currentColor; padding: 0in 5.4pt; width: 256.25pt;" valign="top" width="342">
<p style="line-height: normal; margin-bottom: 0pt;"><span style="font-size: small;"><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207027(v=vs.105).aspx">How to use the share media task for Windows Phone</a></span></p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
<p style="line-height: normal; margin-bottom: 0pt;">&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-size: small;">Follow us on Twitter @wsdevsol.</span></p>
<p>&nbsp;</p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio 2012's simulator causes video to stop playback when orientation is changed</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/visual-studio-2012s-simulator-causes-video-to-stop-playback-when-orientation-is-changed</link>
      <pubDate>Fri, 31 Aug 2012 14:46:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2012/08/31/visual-studio-2012s-simulator-causes-video-to-stop-playback-when-orientation-is-changed/</guid>
      <description><![CDATA[Just a quick post to let you know that one of my friends on the forums discovered that if you are...]]></description>
      <content:encoded><![CDATA[<p>Just a quick post to let you know that one of my friends on the forums discovered that if you are using the VS 2012 simulator and playing back video, if you change the orientation of the simulator, the video will stop playing back. Actually if you handle the "media failed" event you get an error. The error is a bit strange and complains about audio. This is actually a known issue in the simulator.Unfortunately I don't when or if this is going to be fixed. The team is aware of the problem though so I expect that we will see a fix sometime in the future I just can't say when. The good news is that this problem doesn't affect a slate / tablet / surface device. The issue is specific to the way the simulator is creating a remote desktop connection back to the host PC and&nbsp;remoting audio and video services.</p>]]></content:encoded>
    </item>
    <item>
      <title>MediaElement.Opacity is not supported in Windows store apps (Metro)</title>
      <link>https://docs.microsoft.com/archive/blogs/mediasdkstuff/mediaelement-opacity-is-not-supported-in-windows-store-apps-metro</link>
      <pubDate>Fri, 31 Aug 2012 14:39:00 GMT</pubDate>
      <dc:creator><![CDATA[James Dailey - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mediasdkstuff/2012/08/31/mediaelement-opacity-is-not-supported-in-windows-store-apps-metro/</guid>
      <description><![CDATA[Just a quick note to let the media development community know that we don't support the "opacity"...]]></description>
      <content:encoded><![CDATA[<p>Just a quick note to let the media development community know that we don't support the "opacity" property on the MediaElement. The current documentation (as of the date of this writing) does not detail this limitation of the MediaElement control in the Windows store app (WSA)&nbsp;development environment (formerly Metro). I&nbsp;am working with the documentation folks to get this updated and hopefully we will see an update before too long.</p>
<p>The reason for this limitation is due to the way that the Media Engine (the underlying component that drives the MediaElement) is being used by the XAML framework. There are a number of modes that the Media Engine can use to deliver frames to a rich compositor such as the&nbsp;XAML framework. The Media Element can work&nbsp;in either&nbsp;frame-server or&nbsp;rendering mode. Frame-server mode allows the Media Engine to offer up individual frames that can be used in a composition chain. Rendering mode allows the Media Engine to render directly on a "DirectComposition" (DComp)&nbsp;surface provided by the application. In the current XAML framework implementation we use DComp for the rendering.</p>
<p>DComp has the benefit of being hardware accelerated and is integrated directly into the DWM. This gives the MediaElement the best possible video playback&nbsp;performance and allows it to have a frame-rate independent of its XAML host.</p>]]></content:encoded>
    </item>
  </channel>
</rss>