Example #1
0
        private void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else
            {
                Destroy(gameObject);
            }

#if UNITY_ANDROID && !UNITY_EDITOR
            if (AndroidPlugin.IsSupportedSpeechRecognizer())
            {
                IsNativeTextToSpeechSupported = true;
            }
#endif

#if UNITY_IOS && !UNITY_EDITOR
            if (SpeechRecognizer.ExistsOnDevice())
            {
                IsNativeTextToSpeechSupported = true;
            }

            if (OSXNativePlugin.getInstance().hasServices("") == 1)
            {
                IsNativeTextToSpeechSupported = true;
            }
#endif
        }
Example #2
0
        public void RecordSpeech(string text, bool playAfterRecording)
        {
#if UNITY_IOS
            if (OSXNativePlugin.getInstance().isBackFromNative())
            {
                OSXNativePlugin.getInstance().closeNativeAVAudioSession();
            }
#endif
            TextToSpeechManager.Instance.RecordSpeech(text, playAfterRecording);
        }