コード例 #1
0
    void Awake()
    {
        //yield;
        if (VoiceAvailable() > 0)
        {
            InitVoice();     // init the engine

            if (voice_nb > GetVoiceCount())
            {
                voice_nb = 0;
            }
            if (voice_nb < 0)
            {
                voice_nb = 0;
            }

            // Unity V4.x.x *******************************************
            IntPtr pStr = GetVoiceName(voice_nb);
            string str  = Marshal.PtrToStringAnsi(pStr);
            Debug.Log("Voice name : " + str);    // Voice Name
            // Unity V4.x.x *******************************************

            //Debug.Log ("Voice name : "+GetVoiceName(voice_nb)); // Voice Name other Unity version

            Debug.Log("Number of voice : " + GetVoiceCount()); // Number of voice

            SetVoice(voice_nb);                                // 0 to voiceCount - 1
            Debug.Log("Voice Rate : " + GetVoiceRate());
            SetVoice(0);
            SetVoiceRate(0);

            //Debug.Log ("Voice name : "+GetVoiceName(voice_nb));
            // Say("All system nominal. Engine, online, weapons, online.. We are ready. 9.,.8.,.7.,.6.,.5.,.4.,.3.,.2.,.1.,.0.,. Go,.Take off");
            // Say("Tout les systèmes sont opérationnels. Moteurs, en ligne. Armement, en ligne. Nous sommes prêt. 9.,.8.,.7.,.6.,.5.,.4.,.3.,.2.,.1.,.0.,. .Décollage" );
        }
        current = this;
    }