chenshijun
2019-12-16 0bbac062b44db5383da377c83ba450c207794a6c
hikvoice.go
@@ -8,11 +8,24 @@
#include <stdlib.h>
#include "Voice.h"
*/
import "C"
import (
   "unsafe"
)
// SendVoice Send Voice
func SendVoice(ip,usrname,passwd,voiceFilePath string) int {
   return int(C.SendVoice(C.CString(ip), C.CString(usrname), C.CString(passwd), C.CString(voiceFilePath)))
   cip := C.CString(ip)
   defer C.free(unsafe.Pointer(cip))
   cusrname := C.CString(usrname)
   defer C.free(unsafe.Pointer(cusrname))
   cpasswd := C.CString(passwd)
   defer C.free(unsafe.Pointer(cpasswd))
   cvoiceFilePath := C.CString(voiceFilePath)
   defer C.free(unsafe.Pointer(cvoiceFilePath))
   cRet := C.SendVoice(cip, cusrname, cpasswd, cvoiceFilePath)
   return int(cRet)
}