public async void vocalizeText(string text) { string audioFile = ""; var webServices = new ITranscribeAndVocalize <Voice>[] { amazonWebService, googleWebService, ibmWebService }; var activeService = webServices[settings.generalSettings.ActiveTextToSpeechService - 1]; audioFile = await activeService.ToAudio(text); var textToSpeech = new TextToSpeech { Text = text, AudioFile = audioFile }; textToSpeech.Id = await textToSpeechRepository.Insert(textToSpeech); var viewModel = new VocalizedViewModel(textToSpeech, container.Resolve <IAudioPlayer>(), container.Resolve <ISettingsService>()); VocalizedViewModels.Add(viewModel); if (audioFile != "" && settings.generalSettings.IsAutoPlayVocalized) { viewModel.PlayHandler(audioFile); } }