package stt import ( "fmt" "mybatch/icsconf" "mybatch/icserror" "os" "strconv" "testing" ) var config icsconf.AppInfo func init() { config = icsconf.Getconfig() } func TestXXX(t *testing.T) { data, _ := os.ReadFile("/home/prac/svc/icsbc/voice/pcm/20250913223412/20250913223412-left.pcm") connectSttServer() sttResTest(data) } func connectSttServer(voicedata []byte) (bool, *icserror.IcsError) { var s *STTSelvas var sttErr *icserror.IcsError ip := config.STT.SrcIP port, _ := strconv.Atoi(cfg.STT.Port) callId := "00ef1234567899001" custid := "3002" RecordFilePath := "/home/prac/svc/icsbc/sttres" // func NewSTTS(sid int, IP string, port int, callID string, custID string, filePath string) s, sttErr = NewSTTS(ip, port, callId, custid, RecordFilePath) if sttErr != nil { return false, icserror.ICSERRSTTConnectFail } else if s != nil { fmt.Println("STT session:", s) } fmt.Println("stt server is connected with: ", ip, ", port: ", port) return true, nil } func sttResTest(voicedata []byte) (bool, *icserror.IcsError) { }