问题
I am trying to point to a file in the content of my XNA project. By default the method looks in the bin folder
enigine.play("Sound.wav")
How do I direct it to the content?
回答1:
Use ContentManager.Load<SoundEffect>()
method:
var sound = Content.Load<SoundEffect>("Sound");
sound.Play();
where Content
is a reference to your ContentManager
instance.
来源:https://stackoverflow.com/questions/6103839/how-to-point-to-file-in-content-in-xna