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 # Shared utils
########################################################################## ##########################################################################
def playFromText(text, exclude=""): _soundReg = "\[sound:(.*?)\]"
reg = "\[sound:(.*?)\]"
fnames = {} def playFromText(text):
for match in re.findall(reg, exclude): for match in re.findall(_soundReg, text):
fnames[match] = True
for match in re.findall(reg, text):
if match in fnames:
continue
fnames[match] = True
play(match) play(match)
def stripSounds(text): def stripSounds(text):
return re.sub("\[sound:.*?\]", "", text) return re.sub(_soundReg, "", text)
def hasSound(text): def hasSound(text):
return re.search("\[sound:.*?\]", text) is not None return re.search(_soundReg, text) is not None
########################################################################## ##########################################################################