void Start() { LogSystem.InstallDefaultReactors(); Runnable.Run(CreateService()); _service.StopListening(); }
public void StopTalking() { if (_speechToText.IsListening) { StopCoroutine(_pushAudioChunkCroutine); _pushAudioChunkCroutine = null; StopCoroutine(_stopListeningTimeoutCoroutine); _stopListeningTimeoutCoroutine = null; _speechToText.StopListening(); if (PlayBackAudio) { AudioClip clip = AudioClip.Create("testClip", _playBackAudioData.Count, _rollingAudioClip.channels, MIC_FREQUENCY, false); clip.SetData(_playBackAudioData.ToArray(), 0); AudioSrc.clip = clip; AudioSrc.Play(); } if (StoppedListening != null) { StoppedListening(); } } }