private void PlayPronunciationAudio(List <string> words, WhenEnum whenWasInvoked, AnswerTypeEnum answerType) { if (whenWasInvoked == WhenEnum.BeforeAnswer && !AudioCanBePlayedBeforeAnswer(answerType)) { return; } if (whenWasInvoked == WhenEnum.AfterAnswer && !AudioCanBePlayedAfterAnswer(answerType)) { return; } if (AppSettings.PronunciationApi == null) { return; } _ = PronunciationService.PlayAsync(words.ToList()) .ContinueWith( x => PronunciationLogger.LogError( x.Exception, "An unexpected error occured in pronunciation service." ), TaskContinuationOptions.OnlyOnFaulted ); }
private async Task <bool> PronunciationAudioExists(List <string> words) { return(await PronunciationService.AudioExists(words)); }