Question

I'm making a game in XNA... I havent looked at monogame yet but I'm conscious that I probably will be looking at it in the future..

I havent implemented sounds in my game yet.. Atmosphere is very imprtant in this game so different reverb and delay on the sounds in different rooms is important.

I could use XACT to do this dynamically, however I know XACT is not supported by Monogame

Is there something else I could look at??

What I could do is record 3 versions of each sound effect with little, medium and high reverb and just play different ones depending on what room you are in.. I think this would work ok and I'm assuming with less real-time audio processing going on it will be lighter on CPU.

Was it helpful?

Solution

This is an old question, but I think it still needs an appropriate answer for the one who are looking for an answer.

For sound in Monogame, you can use SoundEffect or MediaPlayer classes to play audio.

Example for SoundEffect class:

  • Declaration: SoundEffect soundEffect;
  • In LoadContent(): soundEffect= Content.Load<SoundEffect>("sound_title");
  • In wherever you want to play this sound: soundEffect.Play();

Example for SoundEffectInstances class (using SoundEffect that created above):

SoundEffectInstance soundEffectInstance = effect.CreateInstance();    
soundEffectInstance.Play();

Then you can stop the soundeffect from playing whenever you want by using: soundEffectInstance.Stop();

Example for MediaPlayer class (best for background music): In LoadContent():

Song song = Content.Load<Song>("song_title");
MediaPlayer.Play(song);

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top