SilverlightShow: Exploring Silverlight-XNA integration on Windows Phone 7 Comments http://www.silverlightshow.net/ Silverlight articles, Silverlight tutorials, Silverlight videos, Silverlight samples SilverlightShow.net http://www.rssboard.org/rss-specification Argotic Syndication Framework 2008.0.2.0, http://www.codeplex.com/Argotic en-US estoychev@completit.com (Emil Stoychev) RE: Exploring Silverlight-XNA integration on Windows Phone 7 Dont download this.. This is not working in VS2010 and it affects my C drive and slow down my system performance...  Be careful.. http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment5839 Wellwisher http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Tue, 05 Apr 2011 10:24:27 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 I'm kinda clueless here, it seems like a bug. On the emulator I can't load songs from the MediaLibrary (it's empty), and I don't have a device yet. What method are you using? Did you try this one maybe? http://msdn.microsoft.com/en-us/wp7trainingcourse_2dgamedevelopmentwithxnapart2lab_topic2.aspx http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4967 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Fri, 26 Nov 2010 10:47:11 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 I have the same question with windblow. It will be great that you have insight on this.  Thanks! http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4952 DriftBottles http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Wed, 24 Nov 2010 08:43:47 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>Hi, I have a question regarding integrating the XNA's MediaLibrary</p> <p>  I am trying to use MediaLibrary to load all the songs and then play the songs using MediaPlayer.play(song). However, I find that it only works when the emulator is started by Visual Studio debug mode. Otherwise, the MediaLibrary cannot find any song in the mediaLibrary(including on the real phone). A workaround is if I enter Gamehub first, then run my application, it will load all the songs from the MediaLibrary with no problem. I know this might be a bug in WP7. But do you have any idea what does the "entering gamehub" do so that the songs in the MediaLibrary is accessible again? </p> <p>Thanks!</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4951 windblow http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Wed, 24 Nov 2010 08:01:45 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 I couldn't reproduce it, but you can still stop it in the Application_Closing and Application_Deactivated (App.xaml.cs) methods by stopping its DispatchTimer. http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4928 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 20 Nov 2010 13:55:21 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>When I add the XNAAsyncDispatcher to my application I get this exception on exit:</p> <p>A first chance exception of type 'System.Threading.ThreadAbortException' occurred in Microsoft.Xna.Framework.dll  </p> <p>Do you know why this is happening?</p> <p>Thanks</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4912 dev http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Thu, 18 Nov 2010 23:24:56 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 glad to help, thanks :) http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4791 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sun, 31 Oct 2010 10:36:39 GMT FrameworkDispatcher <p>Thanks for your really useful article,</p> <p>I had some problems with updating that "FrameworkDispatcher", and you solved it ;)</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4790 Siavash Mortazavi http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 30 Oct 2010 23:16:33 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>Thanks a lot!</p> <p>Now everything is working fine.</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4789 tsjDEV http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 30 Oct 2010 15:08:30 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>Hi,</p> <p> you have to put this in the App's constructructor (in App.xaml.cs) </p> <p>public App()<br />         {</p> <p>..</p> <p>this.ApplicationLifetimeObjects.Add(new XNAAsyncDispatcher(TimeSpan.FromTicks(333333)));</p> <p>..</p> <p>};</p> <p>and this is the ApplicationLifeTimeObjects (but i think you have that figured out):</p> <p><a href="http://msdn.microsoft.com/en-us/library/system.windows.application.applicationlifetimeobjects%28VS.95%29.aspx">http://msdn.microsoft.com/en-us/library/system.windows.application.applicationlifetimeobjects%28VS.95%29.aspx</a></p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4787 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 30 Oct 2010 11:50:48 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>Hello,</p> <p>thanks for your post. I want to play a simple sound after pressing a button in Silverlight with the XNA-Framework. I realize this with your code snippet, but it don't work. The program told me, that there was no definition for ApplicationLifetimeObjects. Where have I put that? I've put it in the constructor of my MainPage, was this wrong?</p> <p>Thanks.</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4786 tsjDEV http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 30 Oct 2010 08:43:49 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>Thanks, you're right, something is wrong with the snippet boxes, the copy icon is not appearing. I'll try to fix it.</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4713 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Wed, 20 Oct 2010 10:06:25 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 Thanks for posting this - really helped me out.  FYI, having the line numbers in your code samples make it a pain in the ass to copy your code. http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4711 John http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Wed, 20 Oct 2010 05:22:12 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>after you saved it:</p> <p> using (var isf = IsolatedStorageFile.GetUserStoreForApplication())<br />                 {<br />                     using (var isfstream = new IsolatedStorageFileStream("effect.wav", FileMode.Create, isf))<br />                     {<br />                         isfstream.Write(soundByteArray, 0, (int)soundByteArray.Length);<br />                     }<br />                 }</p> <p>you can play it like this:</p> <p>using (var isf = IsolatedStorageFile.GetUserStoreForApplication())<br />                 {<br />                     using (var file = isf.OpenFile("effect.wav", FileMode.Open))<br />                     {<br />                         byte[] buffer = new byte[file.Length];<br />                         file.Read(buffer, 0, (int)file.Length);<br />                         effectSE = new SoundEffect(buffer, sampleRate, AudioChannels.Mono);<br />                     }<br />                 }<br /> <br />                 effectSE .Play();</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4699 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sun, 17 Oct 2010 17:28:24 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 IsolatedStorage. http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4696 Darick http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sun, 17 Oct 2010 05:32:24 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>hi, </p> <p>are you using the IsolatedStorage (eg. download the sound on runtime and saving to IsolatedStorage) or just adding to the project as content? If the latter, make sure it's build action is set to "Content" (in the Properties window)</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4694 wildfox http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 16 Oct 2010 13:35:01 GMT RE: Exploring Silverlight-XNA integration on Windows Phone 7 <p>I'm trying to play an audio file from isolatedstorage, but I'm getting an error when trying to set the uri.  Can you give a better example of playing an audio file from isolatedstorage?</p> <p>thanks,</p> <p>Darick</p> http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx#comment4690 Darick http://www.silverlightshow.net/items/Exploring-Silverlight-XNA-integration-on-Windows-Phone-7.aspx Sat, 16 Oct 2010 00:42:26 GMT