What kind of audio files can I use in MonoGame?

What kind of audio files can I use in MonoGame?

Fortunately the content pipeline takes care of a great deal of the complications for us. Simply add your audio files ( mp3, mp4, wma, wav, ogg ) to the content pipeline and it will do the rest of the work for you. As you will see shortly though, it is also possible to load audio files outside of the content pipeline.

How to create a sound bank in MonoGame?

First create a new project: Drag and drop your source audio files into the Wave Bank window: Now create a new Sound Bank by right clicking Sound Bank and selecting New Wave Bank Now drag the Wave you wish to use from the Wave Bank to the Sound Bank Now create a Cue by dragging and dropping the Sound Bank to the Cue window.

How do you play a song in MonoGame?

Our Song can then be played with a call to MediaPlayer.Play (). In this example we wire up a MediaStateChanged event handler that will be called when the song completes, decreasing the volume and playing the song again. This example shows playing sound effects.

Do you need a mono audio file for XNA?

It is very important that your source audio file is in Mono ( as opposed to Stereo ) format if you use Apply3D, or an exception will be thrown. As mentioned earlier, XACT used to be the only option when it came to audio programming in XNA.

How do you create sound effect in MonoGame?

If you have need for greater control ( such as changing the volume, looping or applying effects ) you should instead create a SoundEffectInstance using the SoundEffect.CreateInstance () call. You should also create a separate instance if you want to have multiple concurrent instances of the same sound effect playing.

What is the location of the audiolistener in MonoGame?

The AudioListener represents the location of your ear within the virtual world, while the AudioEmitter represents the position of the sound effect. The default location of both is a Vector3 at (0,0,0). You set the position of a SoundEffect by calling Apply3D ().