Reputation: 530
I have a console application that I am trying to incorporate music with. So I decided to go with XNA Framework to get it done, because its the only thing that I know does this.
So I have the Content Manager RootDirectory pointed to a content project that I added. I have the mp3 file located in the project, however, an exception is always thrown saying that it cannot find it once I try to load it.
Is there a way to print out to the Console the contents of the Directory of where I have RootDirectory set to?
What other alternatives might there be if the problem is that I am using Xna, and it is not working because of it not being an Xna project?
Upvotes: 0
Views: 80
Reputation:
Just use good ol' SoundPlayer.Play
The Play method plays the sound using a new thread. If you call Play before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the LoadAsync or Load method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a Stream or URL, future calls to playback methods for the SoundPlayer will not need to reload the .wav file until the path for the sound changes.
Upvotes: 2