locked
Universal fast audio playback for sound effects

    Question

  • Hi there,

    I'm writing a game for W8.1 and W8.1 via a universal app.  I need to play sound effects and sometimes lots in quick succession.  I know I can do this by adding media elements to my xaml but they aren't really effective for this use case, I can only get one sound at a time out of it for example.

    I have seen mention of SharpDX but that doesn't work on WP8.1 as far as I know, or does it?

    Is there any other way that I can play sounds in this way for both W8.1 and WP8.1?

    Nick.


    Somewhere out there...

    Friday, April 18, 2014 11:43 AM

Answers

  • Hi Nick,

    Set up your MediaElements with the AudioCategory SoundEffects (or GameEffects) and you should be good.

    Otherwise you can interop to XAudio2 on either Windows or Windows Phone 8.1. This is probably what SharpDX would do. It looks like Windows Phone 8.1 support is on the SharpDX roadmap but isn't here yet (see http://sharpdx.org/news/sharpdx-next ). You don't need to wait for SharpDX for this but can write your own component to play the sounds.

    --Rob

    • Marked as answer by Firkinfedup Saturday, April 19, 2014 11:05 AM
    Friday, April 18, 2014 8:57 PM
    Owner

All replies

  • Hi Nick,

    Set up your MediaElements with the AudioCategory SoundEffects (or GameEffects) and you should be good.

    Otherwise you can interop to XAudio2 on either Windows or Windows Phone 8.1. This is probably what SharpDX would do. It looks like Windows Phone 8.1 support is on the SharpDX roadmap but isn't here yet (see http://sharpdx.org/news/sharpdx-next ). You don't need to wait for SharpDX for this but can write your own component to play the sounds.

    --Rob

    • Marked as answer by Firkinfedup Saturday, April 19, 2014 11:05 AM
    Friday, April 18, 2014 8:57 PM
    Owner
  • Hi Rob,

    Thanks for the info, I'll have a mess with DirectX to see if I can get something simple working until SharpDX is fully supported on 8.1.

    Thanks :)

    Nick.


    Somewhere out there...

    Saturday, April 19, 2014 11:05 AM