问题
I'm reading this book "Learning XNA 4.0", and in chapter 6 it teaches how to play sounds using XACT Audio files. It asks me to create an AudioEngine object, but I can't find that class.AudioEngine
I have the right using statement (Microsoft.Xna.Framework.Audio) and the right reference (microsoft.xna.framework.dll).
does anybody have any idea whats wrong?
回答1:
This is an error in the documentation. AudioEngine
is actually in the Microsoft.Xna.Framework.Xact
assembly. Add a reference to that, and everything should work as expected.
Note that XACT is not available on Windows Phone 7 (this is why it is in a separate assembly). If you plan to go mobile later, use SoundEffect
instead.
来源:https://stackoverflow.com/questions/8389044/creating-xna-audioengine-on-windows-game-project