package main import ( "fmt" "io/ioutil" "time" "gitlab.com/ics_cinnamon/voicegateway/icspacketparser" "gitlab.com/ics_cinnamon/voicegateway/icsrtp" ) func main() { alawData, ferr := ioutil.ReadFile("../voice/ohmygirl-dolphin-mono.alaw") if ferr != nil { fmt.Println("COULD NOT READ OHMYGIRL'S DOLPHIN!!!", ferr) return } alawDataLen := len(alawData) fmt.Println("alawDataLen", alawDataLen) rtp := icsrtp.NewRTP(1, int(icspacketparser.PCMA), 123, int(time.Now().Unix()), 0x3d99e5cd, alawData[:160]) fmt.Printf("%v\nPayload len: %d\n", rtp, len(rtp.Payload)) }