The way XACT deals with volume, among other things, was a real turn off so I decided to start using SoundEffectInstance to play sounds. All the code is exactly the same only I tried using this function to play sounds.
| SoundEffect soundEffect = Sounds[soundName]; |
| SoundEffectInstance instance = soundEffect.CreateInstance(); |
| |
| |
| instance.Volume = volume; |
| instance.Play(); |
For some reason now sound effects will randomly break. Is there something in XACT that may cause that?
Also, apply3D doesn't seem to work the same way it used to, might there be a reason for that?
One more piece of information! I followed the how to play sounds without XACT guide step by step but it didn't seem to mention that I had to add a reference to audio importer. When I did that it gave a weird error about the .Net Target Framework which I have set to 3.5. I'm not sure if that adds to anything.