无法引用microsoft.xna.framework.media.phoneextensions.dll [英] Unable to reference microsoft.xna.framework.media.phoneextensions.dll
问题描述
我试图按照<一个href="http://stackoverflow.com/questions/4285868/adding-more-music-to-the-windows-phone-7-emulator/23041528#23041528">this回答一些音频文件添加到Windows Phone模拟器的媒体库。但我得到的错误
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因为它不是present在位置
I am unable to reference microsoft.xna.framework.media.phoneextensions.dll as it is not present at the location
C:\ Program Files文件\参考大会\微软\框架\ Silverlight的\ V4.0 \档案\ WindowsPhone71
C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71
我安装微软XNA游戏工作室4.0,但仍无法找到系统文件夹中的DLL。
我试过,但无法得到的DLL随时随地在互联网上。
这是我的code(如果它事项)
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家庭基本版。
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框架dll文件:
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.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屋!