示例#1
0
        public ForecastDetailModel(IWeatherService weatherService, ITextToSpeechService textToSpeechService)
        {
            _weatherService      = weatherService;
            _textToSpeechService = textToSpeechService;

            InitData();
        }
        public void Dispose()
        {
            text_to_speech_service.Stop();
            text_to_speech_service = null;

            return;
        }
示例#3
0
 public ParsedSentToAudioService(
     ITextToSpeechService textToSpeechService,
     IParsedSentRepository parsedSentRepository)
 {
     _textToSpeechService  = textToSpeechService;
     _parsedSentRepository = parsedSentRepository;
 }
示例#4
0
        public MainViewModel(IMscsService mscsService, ISerializationService serializationService,
                             IPhotoService photoService, IMessageBoxService messageBoxService,
                             ITextToSpeechService textToSpeechService, ILocationService locationService,
                             IGeocodingService geocodingService, ISpeechToTextService speechToTextService,
                             IPublicTransportServices publicTransportServices,
                             ITranslationService translationService,
                             IMvxAndroidCurrentTopActivity activity)
        {
            this._mscsService             = mscsService;
            this._photoService            = photoService;
            this._messageBoxService       = messageBoxService;
            this._textToSpeechService     = textToSpeechService;
            this._locationService         = locationService;
            this._geocodingService        = geocodingService;
            this._speechToTextService     = speechToTextService;
            this._publicTransportServices = publicTransportServices;
            this._translationService      = translationService;

            this._checkNetwork  = new CheckInternetConnection();
            this._checkLocation = new CheckLocationAvailability();

            this._speechToTextService.MessageChanged += HandleMessageChanged;
            this._photoService.PhotoChanged          += HandlePhotoChanged;

            _textToSpeechService.Speak(
                "Witaj w aplikacji blind. Tapnij na ekran i powiedz komende dla danej funkcji. Aby uzyskaæ informacjê o dostêpnych funkcjach tapnij w ekran i powiedz menu");

            CheckSettingsAfterStart();
        }
示例#5
0
        public ViewBViewModel(IEventAggregator eventAggregator, ITextToSpeechService textToSpeechService)
        {
            _textToSpeechService = textToSpeechService;

            eventAggregator.GetEvent<MessageSentEvent>().Subscribe(MessageSent);

            SpeakCommand = new DelegateCommand(Speak);
        }
 public NotificationService(IPageDialogService dialogService,
                            ITextToSpeechService textToSpeechService,
                            ISoundService soundService)
 {
     _dialogService       = dialogService;
     _textToSpeechService = textToSpeechService;
     _soundService        = soundService;
 }
示例#7
0
        public ViewBViewModel(IEventAggregator eventAggregator, ITextToSpeechService textToSpeechService)
        {
            _textToSpeechService = textToSpeechService;

            eventAggregator.GetEvent <MessageSentEvent>().Subscribe(MessageSent);

            SpeakCommand = new DelegateCommand(Speak);
        }
示例#8
0
        async void OnSpeakButtonClicked(object sender, EventArgs e)
        {
            ITextToSpeechService service = DependencyService.Get <ITextToSpeechService>(DependencyFetchTarget.NewInstance);

            using (service as IDisposable)
            {
                await service.SpeakAsync("Hello world");
            }
        }
 public TextToSpeechViewModel(ITextToSpeechService speech, IUserDialogService dialogs) {
     this.Speak = new Command(() => {
         if (String.IsNullOrEmpty(this.Text)) 
             dialogs.Alert("Please enter the text!");
         else 
             speech.Speak(this.Text);
     });
     this.Cancel = new Command(speech.Stop);
 }
示例#10
0
        public DSPageViewModel(ITextToSpeechService textToSpeech, IDeviceOrientationService deviceOrientation, IPhotoPickerService photoPicker)
        {
            _textToSpeech      = textToSpeech;
            _deviceOrientation = deviceOrientation;
            _photoPicker       = photoPicker;

            OnSpeakCommandClicked       = new DelegateCommand(Speak);
            OnOrientationCommandClicked = new DelegateCommand(GetOrientation);
            OnPhotoPickerCommandClicked = new DelegateCommand(PickPhoto);
        }
示例#11
0
        //I am using Constructor Injection for the services we need.  This was set up in the Startup.cs file
        public SpeechController(IOptions <TwilioAccount> account, ITextToSpeechService textToSpeechService)
        {
            _textToSpeechService = textToSpeechService ?? throw new ArgumentNullException(nameof(textToSpeechService));
            var acc = account.Value ?? throw new ArgumentNullException(nameof(account));

            TwilioClient.Init(
                acc.AccountSid,
                acc.AuthToken
                );
        }
示例#12
0
 public MainPageModel(
     INavigation navigation,
     AnalyticsService analyticsService,
     ISettingsProvider settingsProvider,
     ITextToSpeechService ttsService
     )
 {
     _navigation       = navigation;
     _analyticsService = analyticsService;
     _ttsService       = ttsService;
     _settingsProvider = settingsProvider;
 }
示例#13
0
 public MainPageViewModel(INavigationService navigationService, ITextToSpeechService textToSpeechService, IQRScanService qrScanService, IAttendeeRepository attendeeRepository, ISoundService soundService)
     : base(navigationService)
 {
     Title = "MVP Conference 2019";
     this.textToSpeechService = textToSpeechService;
     this.qrScanService       = qrScanService;
     this.attendeeRepository  = attendeeRepository;
     this.soundService        = soundService;
     ScanCommand          = new DelegateCommand(Scan, HasSession).ObservesProperty(() => CurrentSession);
     SelectSessionCommand = new DelegateCommand(SelectSession);
     SettingsCommand      = new DelegateCommand(Settings);
 }
示例#14
0
 public BackDoorLightControl(IHaContext ha, ITextToSpeechService tts, ILogger <BackDoorLightControl> logger)
 {
     _tts      = tts;
     _logger   = logger;
     _entities = new Entities(ha);
     //var t = new Services(ha);
     //ha.Services.Tts.Say.
     PatioCameraPersonDetected();
     PatioCameraCarDetected();
     PatioDoorIsOpened();
     PatioNoMotionAndDoorClosed();
     PatioDoorClosed();
 }
 public TextToSpeechViewModel(ITextToSpeechService speech, IUserDialogService dialogs)
 {
     this.Speak = new Command(() => {
         if (String.IsNullOrEmpty(this.Text))
         {
             dialogs.Alert("Please enter the text!");
         }
         else
         {
             speech.Speak(this.Text);
         }
     });
     this.Cancel = new Command(speech.Stop);
 }
示例#16
0
        public void Initialize()
        {
            _windowService              = A.Fake <IWindowService>();
            _dataTransferService        = A.Fake <IDataTransferService>();
            _clipboardService           = A.Fake <IClipboardService>();
            _httpService                = A.Fake <IHttpService>();
            _schedulerProvider          = A.Fake <ISchedulerProvider>();
            _textToSpeechService        = A.Fake <ITextToSpeechService>();
            _applicationSettingsService = new ApplicationSettingsService(new MockApplicationDataContainer());
            _uiSettingsService          = A.Fake <ISettingsService>();
            _shareDataRepository        = A.Fake <IShareDataRepository>();
            _navigationService          = A.Fake <INavigationService>();

            A.CallTo(() => _schedulerProvider.Default).Returns(_testScheduler);
        }
        public TouchSpeechToTextService()
        {
            MappingService      = Mvx.Resolve <ITextFromSpeechMappingService>();
            TextToSpeechService = Mvx.Resolve <ITextToSpeechService>();

            observer = new OEEventsObserver();
            observer.WeakDelegate  = new MyOpenEarsEventsObserverDelegate(this);
            pocketSphinxController = new OEPocketsphinxController();
            fliteController        = new OEFliteController();

            firstVoiceToUse     = "cmu_us_slt";
            secondVoiceToUse    = "cmu_us_rms";
            pathToLanguageModel = NSBundle.MainBundle.ResourcePath + System.IO.Path.DirectorySeparatorChar + "OpenEars1.languagemodel";
            pathToDictionary    = NSBundle.MainBundle.ResourcePath + System.IO.Path.DirectorySeparatorChar + "OpenEars1.dic";
            pathToAcousticModel = NSBundle.MainBundle.ResourcePath + System.IO.Path.DirectorySeparatorChar + "AcousticModelEnglish.bundle";
        }
        public MainPageViewModel(IWindowService windowService,
                                 IDataTransferService dataTransferService,
                                 IClipboardService clipboardService,
                                 IHttpService httpService,
                                 ISchedulerProvider schedulerProvider,
                                 ITextToSpeechService textToSpeechService,
                                 ApplicationSettingsService settingsService,
                                 ISettingsService settingsUiService,
                                 INavigationService navigationService)
        {
            Text = DefineClipboardObservable(windowService.IsVisibleObservable, clipboardService).ToReactiveProperty();

            SelectAllTextTrigger = DefineSelectAllTextTriggerObservable(windowService.IsVisibleObservable, schedulerProvider.Default)
                                   .ToReadonlyReactiveProperty(mode: ReactivePropertyMode.None);

            var formattedStringObservable = DefineFormattedStringObservable(Text);

            var validLinkObservable = DefineValidUriObservable(formattedStringObservable);

            ShareCommand      = validLinkObservable.ToReactiveCommand();
            KeyPressedCommand = validLinkObservable.ToReactiveCommand <object>();

            var enterPressedObservable = DefineEnterPressedObservable(KeyPressedCommand);

            var shareTrigger = DefineShareTrigger(formattedStringObservable, ShareCommand, enterPressedObservable);

            var urlTitleResolveObservable = DefineUrlTitleResolveObservable(shareTrigger, httpService);

            IsInProgress = DefineInProgressObservable(shareTrigger, urlTitleResolveObservable)
                           .ToReadonlyReactiveProperty();

            ErrorMessage = DefineErrorMessageObservable(shareTrigger, urlTitleResolveObservable)
                           .ToReadonlyReactiveProperty();

            _textToSpeechSubscription = DefineTextToSpeachObservable(urlTitleResolveObservable, settingsService, textToSpeechService)
                                        .Subscribe();

            _shareLinkSubscription = urlTitleResolveObservable.ObserveOnUI()
                                     .Subscribe(shareData => ShareLink(dataTransferService, shareData.Title, shareData.Uri));

            SettingsCommand = new DelegateCommand(settingsUiService.ShowSettings);
            HistoryCommand  = new DelegateCommand(() => navigationService.Navigate("History", null));
        }
        public TrackFacade(ITextToSpeechService textToSpeech, IMvxMessenger messenger, IGeoLocationWatcher geoWatcher,
                           IMotionActivity activity, IStoredSettingsService storedSettingsService, IWaypointChecker waypointChecker)
        {
            Log.LogMessage("Facade ctor start");
            _textToSpeech          = textToSpeech;
            _messenger             = messenger;
            _geoWatcher            = geoWatcher;
            _activity              = activity;
            _storedSettingsService = storedSettingsService;
            this.waypointChecker   = waypointChecker;

            _tokens      = new List <MvxSubscriptionToken>(); // was changed
            _semaphor    = new SemaphoreSlim(1);
            _motionToken = _messenger.SubscribeOnThreadPoolThread <MotionMessage>(async x =>
            {
                Log.LogMessage($"[FACADE] receive new motion type {x.Data}");
                switch (x.Data)
                {
                case MotionType.Automotive:
                case MotionType.Running:
                case MotionType.Walking:
                    if ((_storedSettingsService.SleepGPSDateTime == DateTime.MinValue || _storedSettingsService.SleepGPSDateTime < DateTime.Now) &&
                        !IsBound)
                    {
                        Log.LogMessage($"[FACADE] Start geolocating because we are not still");
                        await StartServicesAsync();
                    }
                    break;

                case MotionType.Still:
                    if (IsBound)
                    {
                        Log.LogMessage($"[FACADE] Stop geolocating because we are still");
                        StopServices();
                    }
                    break;
                }
            });
            _tokens.Add(_motionToken);
            Log.LogMessage("Facade ctor end");
        }
示例#20
0
        public TrackFacade()
        {
            Log.LogMessage("Facade ctor start");
            _textToSpeech          = Mvx.Resolve <ITextToSpeechService>();
            _messenger             = Mvx.Resolve <IMvxMessenger>();
            _geoWatcher            = Mvx.Resolve <IGeoLocationWatcher>();
            _activity              = Mvx.Resolve <IMotionActivity>();
            _storedSettingsService = Mvx.Resolve <IStoredSettingsService>();

            _semaphor = new SemaphoreSlim(1);

            //_motionToken = _messenger.SubscribeOnThreadPoolThread<MotionMessage>(async x =>
            //  {
            //      Log.LogMessage($"[FACADE] receive new motion type {x.Data}");
            //      switch (x.Data)
            //      {
            //          case MotionType.Automotive:
            //          case MotionType.Running:
            //          case MotionType.Walking:
            //              if ((_storedSettingsService.SleepGPSDateTime == DateTime.MinValue || _storedSettingsService.SleepGPSDateTime < DateTime.Now)
            //                  && !IsBound)
            //              {
            //                  Log.LogMessage($"[FACADE] Start geolocating because we are not still");
            //                  await StartServices();
            //              }
            //              break;
            //          case MotionType.Still:
            //              if (IsBound)
            //              {
            //                  Log.LogMessage($"[FACADE] Stop geolocating because we are still");
            //                  StopServices();
            //              }
            //              break;
            //      }
            //  });
            //_tokens.Add(_motionToken);

            Log.LogMessage("Facade ctor end");
        }
 public TextToSpeechViewModel(ITextToSpeechService speech, IUserDialogService dialogs)
 {
     this.Speak  = new Command(async() => {
         //            if (String.IsNullOrEmpty(this.Text))
         //                this.dialogService.Alert("Please enter the text!");
         //            else {
         //                using (this.cancelSource = new CancellationTokenSource()) {
         //                    using (this.dialogService.Loading("Speaking", () => this.cancelSource.Cancel(false))) {
         //                        await this.SpeechService.Speak(this.Text, cancelToken: this.cancelSource.Token);
         //                    }
         //                }
         //                this.cancelSource = null;
         //            }
     });
     this.Cancel = new Command(async() => {
         //            if (this.cancelSource == null)
         //                this.dialogService.Alert("Nothing to cancel");
         //            else {
         //                this.cancelSource.Cancel();
         //                this.dialogService.Alert("Cancelled");
         //            }
     });
 }
 public NotifyService(IPlatform platform, ITextToSpeechService textToSpeech, INotificationSender notificationSender)
 {
     this._notificationSender = notificationSender;
     this._textToSpeech       = textToSpeech;
     this._platform           = platform;
 }
示例#23
0
 public Handler(ILanguagerContext context, ITextToSpeechService textToSpeechService)
 {
     _context             = context;
     _textToSpeechService = textToSpeechService;
 }
示例#24
0
 public TextSpeechPageViewModel(ITextToSpeechService textToSpeechService)
 {
     _textToSpeechService = textToSpeechService;
 }
 private static IObservable <System.Reactive.Unit> DefineTextToSpeachObservable(IObservable <ShareData> shareFinishedObservable, ApplicationSettingsService settingsService, ITextToSpeechService textToSpeechService)
 {
     return(shareFinishedObservable.Where(_ => settingsService.IsSpeechEnabled)
            .Where(shareData => !string.IsNullOrEmpty(shareData.Title))
            .SubscribeOnUI()
            .ObserveOnUI()
            .Select(shareData => Observable.FromAsync(token => textToSpeechService.PlayTextAsync(shareData.Title, token)))
            .Switch());
 }
 public TTSTaskProcessor(ITextToSpeechTaskService textToSpeechTaskService, ITextToSpeechService textToSpeechService)
 {
     this._textToSpeechService     = textToSpeechService;
     this._textToSpeechTaskService = textToSpeechTaskService;
 }
示例#27
0
 public Handler(ILanguagerContext context, ITextToSpeechService textToSpeechService, IAuthorizationProvider authorizationProvider)
 {
     _context               = context;
     _textToSpeechService   = textToSpeechService;
     _authorizationProvider = authorizationProvider;
 }
示例#28
0
 public AudioService(ITextToSpeechService textToSpeechService)
 {
     _textToSpeechService = textToSpeechService;
 }
示例#29
0
 public WeatherDetailsViewModel(IWeatherService weatherService, ITextToSpeechService textToSpeechService)
 {
     _weatherService      = weatherService;
     _textToSpeechService = textToSpeechService;
     OnInit();
 }
 public TTSController(ITextToSpeechTaskService textToSpeechTaskService, ITextToSpeechService textToSpeechService)
 {
     this._textToSpeechService     = textToSpeechService;
     this._textToSpeechTaskService = textToSpeechTaskService;
 }
示例#31
0
        public TextToSpeechPageViewModel(ITextToSpeechService textToSpeechService)
        {
            TextToSpeechService = textToSpeechService;

            SpeakCommand = new DelegateCommand(ExecuteSpeakCommand);
        }
        public ContentViewTextToSpeechService()
        {
            InitializeComponent();

            text_to_speech_service = DependencyService.Get <ITextToSpeechService>();
        }