소스 검색

voice recognition test

master
Patrick Peng Sun 8 년 전
부모
커밋
4141982bd0
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. +4
    -0
      server.go

+ 4
- 0
server.go 파일 보기

@@ -61,6 +61,10 @@ func answerWechatPost(w http.ResponseWriter, r *http.Request) {
fmt.Printf("decrypt as: %s", d)
h := ReadCommonHeader(d)
reply, _ := BuildTextMsg(h.MsgType, h.FromUserName)
if h.MsgType == "voice" {
a := ReadVoiceMsg(d)
reply, _ = BuildTextMsg(a.Recognition, h.FromUserName)
}
w.Header().Set("Content-Type", "text/xml; charset=utf-8")
fmt.Fprint(w, reply)
return

Loading…
취소
저장