def GTTSautoread(toread, automatic=automaticQuestions): if not sound.hasSound(toread): if automatic == TTS_tags_only: playTTSFromText(toread) if automatic == TTS_if_no_tag_read_whole: if re.findall("\[GTTS:(.*?):(.*?)\]", toread, re.M | re.I): playTTSFromText(toread) else: TTS_read(toread, TTS_language)
def GTTSautoread(toread, automatic): if not sound.hasSound(toread): if automatic == TTS_tags_only: playTTSFromText(toread) if automatic == TTS_if_no_tag_read_whole: if re.findall("\[GTTS:(.*?):(.*?)\]", toread, re.M|re.I): playTTSFromText(toread) else: TTS_read(toread,TTS_language)
def ATTSautoread(toread, automatic): if not sound.hasSound(toread): if automatic: playTTSFromText(toread)
def _maybeEnableSound(self): self.mw.form.actionRepeatAudio.setEnabled( hasSound(self.card.q() + self.card.a()))