don't play audio files more than once

This commit is contained in:
Damien Elmes 2012-03-24 23:58:37 +09:00
parent eb8326c605
commit 7d3698e2c7

View file

@ -11,7 +11,11 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac
########################################################################## ##########################################################################
def playFromText(text): def playFromText(text):
fnames = {}
for match in re.findall("\[sound:(.*?)\]", text): for match in re.findall("\[sound:(.*?)\]", text):
if match in fnames:
continue
fnames[match] = True
play(match) play(match)
def stripSounds(text): def stripSounds(text):