Changing the Format

Changing a media file’s format is done the same way as changing its quality. It comes down to your choice of MediaEncodingProfile (and in this example, what file extensions you force in the file picker):

async Task ConvertUserSelectedMp4ToWmv() {   // Get a source MP4 file from the user   FileOpenPicker openPicker = new FileOpenPicker();   openPicker.FileTypeFilter.Add(".mp4"); #if WINDOWS_PHONE_APP   // See Chapter 19   ... #else   StorageFile sourceFile = await openPicker.PickSingleFileAsync();   if (sourceFile != null)   {     // Get a target WMV file from the user     FileSavePicker savePicker = new FileSavePicker();     savePicker.FileTypeChoices.Add("WMV file" , new string[] { ".wmv" }); ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.