public TimeSetRunPage(TimeSet timeSet)
        {
            this.TimeSet = timeSet;
            _isEnglish = timeSet.IsEnglish;
            Title = "执行倒计时";
            BackgroundColor = Color.FromHex("#eee");
            _textToSpeech = DependencyService.Get<ITextToSpeech>().New();
            _textToSpeech.Inited += _textToSpeech_Init;
            _textToSpeech.InitedError += _textToSpeech_InitedError;
            _textToSpeech.Init(TimeSet.VoiceEngine);

            _soundService = DependencyService.Get<ISoundService>();

            //
            _performer = new Performer(this.TimeSet);
            _performer.Speak += performer_Speak;
            _performer.PrepareTick += performer_PrepareTick;
            _performer.Tick += performer_HeartBeat;
            _performer.CurrentSecondChanged += performer_CurrentSecondChanged;
            _performer.StageChanged += performer_StageChanged;
            InitView();
            //_textToSpeech.Speak(timeSet.Name);
        }
示例#2
0
 public SpeechService()
 {
     synthesizer = CrossTextToSpeech.Current;
     synthesizer.Init();
 }