Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So your first solution SHOULD work. I have another solution that is very similar with a twist that I KNOW works. </p> <pre><code>static Stream stream1 = TitleContainer.OpenStream("soundeffect.wav"); static SoundEffect sfx = SoundEffect.FromStream(stream1); static SoundEffectInstance soundEffect = sfx.CreateInstance(); public void playSound(){ FrameworkDispatcher.Update(); soundEffect.Play(); } </code></pre> <p>The reason your second solution didnt work is because there are very specific file formats that the windows phone can play. </p> <p>List of supported formats</p> <p><a href="http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff462087(v=vs.105).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff462087(v=vs.105).aspx</a></p> <p>Reference for this code is my blog</p> <p><a href="http://www.anthonyrussell.info/postpage.php?name=60" rel="nofollow">http://www.anthonyrussell.info/postpage.php?name=60</a> </p> <h2>Edit</h2> <p>You can see the above solution working here </p> <p><a href="http://www.windowsphone.com/en-us/store/app/xylophone/fe4e0fed-1130-e011-854c-00237de2db9e" rel="nofollow">http://www.windowsphone.com/en-us/store/app/xylophone/fe4e0fed-1130-e011-854c-00237de2db9e</a></p> <h2>Edit#2</h2> <p>In response to the comment below that this code doesn't work I have also posted a working, published app on my blog that implements this very code. It's called Xylophone, it's free and you can download the code here at the bottom of the page.</p> <p><a href="http://anthonyrussell.info/postpage.php?name=60" rel="nofollow">http://anthonyrussell.info/postpage.php?name=60</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload