public void OnInit(OperationResult status) { if (status == OperationResult.Success) { SetLanguage(Locale.Us); tts.SetOnUtteranceCompletedListener(this); } else { Console.WriteLine("TTS: Initilization Failed!"); } }
Task <bool> Initialize() { if (tcsInitialize != null) { return(tcsInitialize.Task); } tcsInitialize = new TaskCompletionSource <bool>(); try { speaker = new TextToSpeech(MainActivity.Instance, this); #pragma warning disable CS0618 speaker.SetOnUtteranceCompletedListener(this); #pragma warning restore CS0618 } catch (Exception ex) { tcsInitialize.TrySetException(ex); } return(tcsInitialize.Task); }