public void Init() { _speechRecognitionManager = ServiceLocator.Get <ISpeechRecognitionManager>(); _mediaManager = ServiceLocator.Get <IMediaManager>(); _threshold = _speechRecognitionManager.CurrentConfig.voiceDetectionThreshold; }
public void Init() { _speechRecognitionManager = GCSpeechRecognition.Instance.ServiceLocator.Get <ISpeechRecognitionManager>(); _voiceDetectionManager = GCSpeechRecognition.Instance.ServiceLocator.Get <IVoiceDetectionManager>(); CheckMicrophones(); }
private void Awake() { if (_Instance != null) { Destroy(gameObject); return; } if (isDontDestroyOnLoad) { DontDestroyOnLoad(gameObject); } _Instance = this; _serviceLocator = new ServiceLocator(); _serviceLocator.InitServices(); _mediaManager = _serviceLocator.Get <IMediaManager>(); _speechRecognitionManager = _serviceLocator.Get <ISpeechRecognitionManager>(); _mediaManager.StartedRecordEvent += StartedRecordEventHandler; _mediaManager.FinishedRecordEvent += FinishedRecordEventHandler; _mediaManager.RecordFailedEvent += RecordFailedEventHandler; _mediaManager.BeginTalkigEvent += BeginTalkigEventHandler; _mediaManager.EndTalkigEvent += EndTalkigEventHandler; _speechRecognitionManager.SetConfig(configs[currentConfigIndex]); _speechRecognitionManager.RecognitionSuccessEvent += RecognitionSuccessEventHandler; _speechRecognitionManager.NetworkRequestFailedEvent += RecognitionFailedEventHandler; _speechRecognitionManager.LongRecognitionSuccessEvent += LongRecognitionSuccessEventHandler; _speechRecognitionManager.GetOperationDataSuccessEvent += GetOperationDataSuccessEventHandler; }
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>(); }
public void Init() { _speechRecognitionManager = GCSpeechRecognition.Instance.ServiceLocator.Get <ISpeechRecognitionManager>(); }