server.py 文件源码

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

项目:chordspeak 作者: nyboer 项目源码 文件源码
def chord():
    chords = request.args.get('transcript')
    confidence = request.args.get('confidence')

    '''do midi stuff with chord request'''
    t = Template("request='${chords}' (${confidence})")

    str = t.substitute({"chords": chords, "confidence": confidence})
    print("========================================")
    print(str)
    print("========================================")

    resp = parser(chords)

    print json.dumps(resp, indent=4, sort_keys=True)

    chord = Chord()
    chord.getchord()

    for note in resp['notes']:
        chord.getchord(note['note'], note['params'][0], resp['octave'])

    chord.play()

    return json.dumps(resp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号