public void Init() { _speechRecognitionManager = GCSpeechRecognition.Instance.ServiceLocator.Get <ISpeechRecognitionManager>(); _voiceDetectionManager = GCSpeechRecognition.Instance.ServiceLocator.Get <IVoiceDetectionManager>(); CheckMicrophones(); }
public void Init() { _speechRepeater = AdvancedSpeechRepeater.Instance; _voiceDetectionManager = _speechRepeater.ServiceLocator.Get <IVoiceDetectionManager>(); _soundContainer = new SoundContainer(); _soundContainer.Init(_speechRepeater.audioConfig, _speechRepeater.transform); CheckMicrophones(); }
private void Awake() { if (_Instance != null) { Destroy(gameObject); return; } if (isDontDestroyOnLoad) { DontDestroyOnLoad(gameObject); } _Instance = this; if (configs.Count == 0) { throw new MissingFieldException("NO CONFIG FOUND!"); } ServiceLocator.Register <ISpeechRecognitionManager>(new SpeechRecognitionManager()); ServiceLocator.Register <IVoiceDetectionManager>(new VoiceDetectionManager()); ServiceLocator.Register <IMediaManager>(new MediaManager()); ServiceLocator.InitServices(); _mediaManager = ServiceLocator.Get <IMediaManager>(); _speechRecognitionManager = ServiceLocator.Get <ISpeechRecognitionManager>(); _voiceDetectionManager = ServiceLocator.Get <IVoiceDetectionManager>(); _mediaManager.RecordStartedEvent += RecordStartedEventHandler; _mediaManager.RecordEndedEvent += RecordEndedEventHandler; _mediaManager.RecordFailedEvent += RecordFailedEventHandler; _mediaManager.TalkBeganEvent += TalkBeganEventHandler; _mediaManager.TalkEndedEvent += TalkEndedEventHandler; _speechRecognitionManager.RecognizeSuccessEvent += RecognizeSuccessEventHandler; _speechRecognitionManager.RecognizeFailedEvent += RecognizeFailedEventHandler; _speechRecognitionManager.LongRunningRecognizeSuccessEvent += LongRunningRecognizeSuccessEventHandler; _speechRecognitionManager.LongRunningRecognizeFailedEvent += LongRunningRecognizeFailedEventHandler; _speechRecognitionManager.GetOperationSuccessEvent += GetOperationSuccessEventHandler; _speechRecognitionManager.GetOperationFailedEvent += GetOperationFailedEventHandler; _speechRecognitionManager.ListOperationsSuccessEvent += ListOperationsSuccessEventHandler; _speechRecognitionManager.ListOperationsFailedEvent += ListOperationsFailedEventHandler; _speechRecognitionManager.SetConfig(configs[Mathf.Clamp(currentConfigIndex, 0, configs.Count - 1)]); }
public void Init() { _voiceDetectionManager = ServiceLocator.Get <IVoiceDetectionManager>(); _speechRecognitionManager = ServiceLocator.Get <ISpeechRecognitionManager>(); }