void PlaySound(int soundID)
{
var res = vm.ResourceManager.GetSound(MusicType, soundID);
if (res == null)
return;
if (vm.Game.GameId == GameId.Monkey1)
{
// Works around the fact that in some places in MonkeyEGA/VGA,
// the music is never explicitly stopped.
// Rather it seems that starting a new music is supposed to
// automatically stop the old song.
if (vm.IMuse != null)
{
if (System.Text.Encoding.UTF8.GetString(res, 0, 4) != "ASFX")
vm.IMuse.StopAllSounds();
}
}
if (vm.MusicEngine != null)
{
vm.MusicEngine.StartSound(soundID);
}
if (vm.TownsPlayer != null)
_currentCDSound = vm.TownsPlayer.GetCurrentCdaSound();
}