serve.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:earmark 作者: lowerquality 项目源码 文件源码
def _process_upload(self, upl, session_id):
        path = os.path.join(self.db.dbdir, '_attachments', upl['path'])

        print 'processing', path

        # XXX: use a tempdir
        outdir = os.path.join(self.db.dbdir, upl['filename'])
        sess = SocketTranscriptionSession(outdir, self.factory, session_id, self.factory.gen_hclg_filename)

        BUF_LEN = 200
        for chunk in numm3.sound_chunks(path, nchannels=1, R=8000, chunksize=BUF_LEN):
            sess.feed(chunk)

        sess.stop()
        sess.join()

        # Clean up: remove the tempdir and the original upload
        os.removedirs(outdir)
        os.remove(path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号