How to play dynamic sounds in XNA?

前端 未结 3 1904
庸人自扰
庸人自扰 2021-01-20 23:02

Is it possible to dynanmically generate sounds with XNA C# code?

I looked into this some time ago when XNA was first released. At that time it was only possible to pl

3条回答
  •  一个人的身影
    2021-01-20 23:39

    Yes.

    XNA 4.0 added support for dynamic audio that allows you to:

    • Create a regular immutable sound effect from a raw buffer using the SoundEffect.FromStream method.
    • Create a DynamicSoundEffectInstance object then modify the audio data of this new streaming sound effect object dynamically.

    Read more in the blog entry What’s “Dynamic” about this SoundEffectInstance? and in the AppHub article Dynamic Audio.

提交回复
热议问题