You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.0 KiB
Go

4 weeks ago
package icsstt
import (
4 weeks ago
"batchmodule/icsconf"
"batchmodule/icserror"
"fmt"
"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) {
}