From 7d3698e2c757fde0d0d7ef1c3f607e891f2b7f63 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sat, 24 Mar 2012 23:58:37 +0900 Subject: [PATCH] don't play audio files more than once --- anki/sound.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/anki/sound.py b/anki/sound.py index c1931028d..2e6e47cc5 100644 --- a/anki/sound.py +++ b/anki/sound.py @@ -11,7 +11,11 @@ from anki.utils import namedtmp, tmpdir, isWin, isMac ########################################################################## def playFromText(text): + fnames = {} for match in re.findall("\[sound:(.*?)\]", text): + if match in fnames: + continue + fnames[match] = True play(match) def stripSounds(text):