无法引用microsoft.xna.framework.media.phoneextensions.dll [英] Unable to reference microsoft.xna.framework.media.phoneextensions.dll

查看:366
本文介绍了无法引用microsoft.xna.framework.media.phoneextensions.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试追踪这个答案将一些音频文件添加到Windows手机模拟器的媒体库。但是我收到错误

I am trying to follow this answer to add some audio files to the windows phone emulator's media library. But I get the error


类型或命名空间名称PhoneExtensions不存在于命名空间Microsoft.Xna.Framework.Media (你缺少一个程序集引用吗?)`

The type or namespace name 'PhoneExtensions' does not exist in the namespace 'Microsoft.Xna.Framework.Media' (are you missing an assembly reference?)`

我无法引用microsoft.xna.framework.media.phoneextensions.dll as它不存在于位置

I am unable to reference microsoft.xna.framework.media.phoneextensions.dll as it is not present at the location


C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\ v4.0\Profile\WindowsPhone71

C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71

我安装了Microsoft XNA Game Studio 4.0,但仍然找不到系统文件夹中的dll 。

我尝试过但无法在互联网上的任何地方得到dll。

这是我的代码(如果重要)

I installed Microsoft XNA Game Studio 4.0 but still could not find the dll in the system folders.
I tried but couldn't get the dll anywhere on internet.
Here's my code (if it matters)

Uri file = new Uri("files/a_wink.mp3", UriKind.Relative);
var myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
var fileStream = myIsolatedStorage.CreateFile("a_wink.mp3");
var resource = Application.GetResourceStream(file);
int chunkSize = 2000000;
byte[] bytes = new byte[chunkSize];
int byteCount;
while ((byteCount = resource.Stream.Read(bytes, 0, chunkSize)) > 0)
    fileStream.Write(bytes, 0, byteCount);
fileStream.Close();
Microsoft.Xna.Framework.Media.PhoneExtensions.SongMetadata metaData =
    new Microsoft.Xna.Framework.Media.PhoneExtensions.SongMetadata();
metaData.AlbumName = "Some Album name";
metaData.ArtistName = "Some Artist Name";
metaData.GenreName = "test";
metaData.Name = "someSongName";

var ml = new MediaLibrary();
Uri songUri = new Uri("someSong.mp3", UriKind.RelativeOrAbsolute);
var song =
    Microsoft.Xna.Framework.Media.PhoneExtensions.MediaLibraryExtensions.SaveSong(
        ml, songUri, metaData,
        Microsoft.Xna.Framework.Media.PhoneExtensions.SaveSongOperation.CopyToLibrary
    );

编辑:
我正在使用Windows Phone SDK 7.1 Vista Home Basic。

I am using Windows Phone SDK 7.1 on Vista Home Basic.

推荐答案

您可以在安装WP8 SDK后找到库。

You can find the library here once you have installed WP8 SDK

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\Microsoft.Xna.Framework.MediaLibraryExtensions.dll

如果您无法安装WP8 SDK的
您可以找到XNA Framework dlls这里:

If you can't install WP8 SDK's You can find the XNA Framework dlls here:

  • Microsoft.Xna.Framework.dll
  • Microsoft.Xna.Framework.GamerServices.dll
  • Microsoft.Xna.Framework.GamerServicesExtensions.dll
  • Microsoft.Xna.Framework.Input.Touch.dll
  • Microsoft.Xna.Framework.MediaLibraryExtensions.dll

这篇关于无法引用microsoft.xna.framework.media.phoneextensions.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆