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 }
public void RecordSpeech(string text, bool playAfterRecording) { #if UNITY_IOS if (OSXNativePlugin.getInstance().isBackFromNative()) { OSXNativePlugin.getInstance().closeNativeAVAudioSession(); } #endif TextToSpeechManager.Instance.RecordSpeech(text, playAfterRecording); }