Well, thanks guys, for now, I did the sound myself, I'll try to explain when I come up with this, test it and find it ok to use.
so first think I did ( it is all C# ) I figured, since MOGRE needs DirectX, I probable use that for sound. As I do not need to add these libraries to my solution (to the output directory), I just reference them and add it to the using list:
using Microsoft.DirectX.DirectSound;
First step i did was check what audio devices were available on the local machine, and return a list with these devices. Once the user selects the device, I can use it as the main audio device.
public class AudioDevice
{
public Guid Id;
public string ModuleName;
public string Description;
}
The guid is important , cause that is what you pass to the actual DirectSound Device object.
public static List<AudioDevice> ListOfDevicesInstalled()
{
DevicesCollection deviceCollection = new DevicesCollection();
List<AudioDevice> audioDevices = new List<AudioDevice>();
for (int i = 0; i < deviceCollection.Count; i++)
{
AudioDevice ad = new AudioDevice();
ad.Id = deviceCollection[i].DriverGuid;
ad.ModuleName = deviceCollection[i].ModuleName;
ad.Description = deviceCollection[i].Description;
audioDevices.Add(ad);
}
return audioDevices;
}
So this peace of code can already serve for the Audio Option in the game.
Now to keep the selected audio device, I created a static property using a singleton pattern.
private static AudioDevice _SelectedAudioDevice;
public static AudioDevice SelectedAudioDevice
{
get { return _SelectedAudioDevice; }
set { _SelectedAudioDevice = value; }
}
This allows me to ask the user, whenever and wherever for the Audio Device, and keep track of it anywhere in the game.
Since we deal with 2D sounds and 3D sounds, I created an interface to work with one object in stead of 2
public interface ISound : IDisposable
{
string SoundName();
void Stop();
void Update(float passedTime);
void Pause();
void Loop();
void Play();
}
I added the sound name because, somewhere in the game I would like to tell my sound manager, play this sound, without me having to know the name of the file.
The update is, to my knowledge, for now
only required for the Sound3D, but at this time I'm not there yet.