I am having a bit of a problem, but let me give you some context first. I am creating a game which involves interactions with robots. Rather than having voice acting, managing speech files, etc., I opted to use a speech generator for these robots. Initially I wanted to use the SpeechSynthesis class found in the System.Speech.Synthesis namespace, which the MSDN docs tell me is available from .NET 3.0 up, but I get an error when I try to use it, namely that Unity’s compiler can’t find the System.Speech namespace (Am I missing an assembly directive?). Then I got the idea (on these forums) to use an external speech engine and have Unity call that program. This works, somewhat.
I can use the System.Diagnostics.Process class to call the speech engine (eSpeak, http://espeak.sourceforge.net/), but i have to know where the speech engine is installed. I’ve noticed that 64-bit systems have a Program Files (x86) folder for 32-bit programs to install themselves in. As eSpeak is a 32-bit program, it installs itself there on my 64-bit laptop. I wast to be able to support 32-bit systems as well, so I need to be able to distinguish between these in order to know where eSpeak is installed so I can know how to call that.
I’ve tried using the PROCESSOR_ARCHITECTURE system variable in the following manner:
public bool is64Bit()
{
string pa = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE");
return ((System.String.IsNullOrEmpty(pa) || pa.Substring(0, 3) == "x86") ? false : true);
}
but that tells me that the processor is 32-bit on my laptop, which I know is a 64-bit system.
My question is this: does anyone know how to determine if a Windows OS is 32 or 64 bit?