void PlaySpeech(byte[] ptr)
{
if (Game.GameId == GameId.Dig && /*(ConfMan.getBool("speech_mute") ||*/ Variables[VariableVoiceMode.Value] == 2)
{
return;
}
if ((Game.GameId == GameId.Dig || Game.GameId == GameId.CurseOfMonkeyIsland) && ptr[0] != 0)
{
var count = Array.IndexOf(ptr, (byte)0);
if (count < 0)
{
count = ptr.Length - 1;
}
var pointer = ptr.GetText(0, count);
// Play speech
if (!Game.Features.HasFlag(GameFeatures.Demo) && Game.GameId == GameId.CurseOfMonkeyIsland) // CMI demo does not have .IMX for voice
{
pointer += ".IMX";
}
Sound.StopTalkSound();
IMuseDigital.StopSound(Sound.TalkSoundID);
IMuseDigital.StartVoice(Sound.TalkSoundID, pointer);
Sound.TalkSound(0, 0, 2);
}
}