no need to exclude/dedupe audio anymore

because audio is stripped from FrontSide, we don't need to jump through hoops
to ensure audio plays correctly anymore
This commit is contained in:
Damien Elmes 2012-07-15 16:46:34 +09:00
parent 2616e95348
commit bd80f31c48

View file

@ -10,22 +10,17 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac
# Shared utils
##########################################################################
def playFromText(text, exclude=""):
reg = "\[sound:(.*?)\]"
fnames = {}
for match in re.findall(reg, exclude):
fnames[match] = True
for match in re.findall(reg, text):
if match in fnames:
continue
fnames[match] = True
_soundReg = "\[sound:(.*?)\]"
def playFromText(text):
for match in re.findall(_soundReg, text):
play(match)
def stripSounds(text):
return re.sub("\[sound:.*?\]", "", text)
return re.sub(_soundReg, "", text)
def hasSound(text):
return re.search("\[sound:.*?\]", text) is not None
return re.search(_soundReg, text) is not None
##########################################################################