English 中文(简体)
mp3 不是通过孤立的储存在轮椅上,而是在推器上工作
原标题:mp3 audio not playing on wp7 device via isolatedstorage but works on emulator

Quite strange that code works fine on emulator but not on device. I am downloading an mp3 via http and storing it on isolatedstorage before I play it. Its like I am caching it forever. Next time if I have to play that mp3 again I simply do it from isolatedstorage. Now that seems to work on emulator but on device I am getting an error thrown by MediaElement (myMedia_MediaFailed function getting called). Debugger shows that file it is trying to play has the right size yet the error is there. I have 7.0 OS of WP7 and can t seem to find any tool which would let me at least grab the mp3 from isolatedstorage to play on PC just to see if file got saved fine. Under mywebClient_OpenReadCompleted function here is the code

isolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication();

bool checkQuotaIncrease = IncreaseIsolatedStorageSpace(e.Result.Length);

string audioFileName = "audiofile.mp3";

isolatedStorageFileStream = new IsolatedStorageFileStream(audioFileName, FileMode.Create, isolatedStorageFile);
long audioFileLength = (long)e.Result.Length;
byte[] byteImage = new byte[audioFileLength];
e.Result.Read(byteImage, 0, byteImage.Length);
isolatedStorageFileStream.Write(byteImage, 0, byteImage.Length);
isolatedStorageFileStream.Flush();

AudioPlayer.SetSource(isolatedStorageFileStream);
AudioPlayer.Play();
问题回答

你们是否试图在电话上安装时关闭祖恩?

当媒体图书馆被锁定时,媒体可以发挥一定的作用。

如果解决你的问题,你可以使用WPConnect。 exe to debug per Zune (more info





相关问题
System.Json namespace missing from Windows Phone 7

During a Mix10 presentation, the presenter (Charlie Kindel) said that when writing Silverlight based apps for WP7 you get all of Silverlight 3.0 with some of Silverlight 4.0 mixed in. Why then is ...

Will Windows Phone 7 Support Multitasking third party apps

Obviously it s early days, I do not know whether this is information that is in the public domain or not yet, but... I have trawled through some of this site - http://www.windowsphone7series.com/ but ...

Windows Series Phone 7 "Cloud"

I have been reading up on "Cloud computing" on here and still not getting it. Basically I want to develop for the WP7 http://msdn.microsoft.com/en-us/library/ff402531%28v=VS.92%29.aspx#...

Windows Phone 7 Tab Pages (page cycle)

I know.. I know, it s only a few hours old. But how the hell do you get the little page tabbing/cycle (forgot what the official name is) on the top of the page under the app title. MIX Keynotes made ...

Recording audio from the microphone in Windows Phone 7 Series

I m wondering if anyone has any code samples or links to documentation that demonstrate how to capture audio from the device s microphone on the new Windows Phone Series 7. I ve recently downloaded ...

Resources for Windows Phone 7 development [closed]

Windows Phone 7 has been unveiled and MS have announced all details of the development chain at the Mix10 conference. So this could be a good starting point/collection of online resources as they ...

热门标签