My XNA SoundEffect alway cut my DynamicSoundEffectInstance RRS feed

  • Question

  • Hello,

    in my game, I generate dynamic music using DynamicSoundEffectInstance, it works great until I try to use the class SoundEffect to play some other audio sound over the music.

    when I call the play() method of any SoundEffect, it always cut the background music played by the DynamicSoundEffectInstance at the end of the SoundEffect.

    Any idea why?

    thank in advance!


    Tuesday, December 23, 2014 5:53 PM

All replies

  • Try post your code here.
    Wednesday, December 24, 2014 9:55 AM
  • hello,

    to play the dynamic background music, I use this code:

    that I modified a bit to work on Windows phone,
    and to play the sound:
    when I called wrong.play(), the music stop at the end of the sound effect...

    SoundEffect wrong;
    StreamResourceInfo SoundFileInfo = App.GetResourceStream(new Uri("music/wrong.wav", UriKind.Relative));
    wrong = SoundEffect.FromStream(SoundFileInfo.Stream);


    Wednesday, December 24, 2014 10:24 AM