Best way to play two audio files simultaneously in Windows Phone 8

后端 未结 2 982
遇见更好的自我
遇见更好的自我 2020-12-18 14:59

Currently looking into how I can go about playing two mp3 or aac format files at the same time in Windows Phone 8.

At the moment I am using the XNA SoundEffect class

2条回答
  •  庸人自扰
    2020-12-18 15:35

    Solution : Hi, I was developing a WP8 App and i needed multiple sounds to play simultaneously, i used the XNA framwork. here is the link

    http://msdn.microsoft.com/en-us/library/ff842408.aspx

    and then play ur sound files like this...

    SoundEffect Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/Sounds/wav/sound.wav", UriKind.Relative)).Stream);
    Sound.Play();
    

    For looping...

    SoundEffectInstance Sound = SoundEffect.FromStream(Application.GetResourceStream(new Uri("Assets/Sounds/wav/sound.wav", UriKind.Relative)).Stream).CreateInstance();
    Sound.IsLooped = true;
    Sound.Play();
    

    Note: the files must be in ".wav" (PCM, 8 or 16-bit, 8KHz to 48KHz, mono or stereo) format

提交回复
热议问题