func (self *Shout) Send(data []byte) (err error) { length := len(data) res := int(C.shout_send(self.shout, (*C.uchar)(unsafe.Pointer(&data[0])), (C.size_t)(length))) if res != C.SHOUTERR_SUCCESS { return self.createShoutError() } return nil }
func (s *Shout) send(buffer []byte) error { ptr := (*C.uchar)(&buffer[0]) C.shout_send(s.struc, ptr, C.size_t(len(buffer))) errno := int(C.shout_get_errno(s.struc)) if errno != C.SHOUTERR_SUCCESS { fmt.Println("something went wrong: %d", errno) } C.shout_sync(s.struc) return nil }