speed up voice rendering

This commit is contained in:
ppwwyyxx
2015-01-08 00:53:16 +08:00
parent add87ef670
commit c2c9de8fcb
2 changed files with 35 additions and 19 deletions
+4 -1
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: render.py
# Date: Thu Jan 08 00:22:33 2015 +0800
# Date: Thu Jan 08 00:53:11 2015 +0800
# Author: Yuxin Wu <[email protected]>
import os
@@ -192,6 +192,9 @@ class HTMLRender(object):
talkers = set([talker_id])
self.prepare_avatar_css(talkers)
voice_paths = [msg.imgPath for msg in msgs if msg.type == TYPE_SPEAK]
self.res.cache_voice_mp3(voice_paths)
logger.info(u"Rendering {} messages of {}({})".format(
len(msgs), self.parser.contacts[talker_id], talker_id))