示例#1
0
文件: simple.go 项目: kaey/pulse
// Latency gets connection latency in usec.
func (conn *Conn) Latency() (uint64, error) {
	clat := C.pa_simple_get_latency(conn.simple, &conn.err.no)
	if conn.err.no != C.int(0) {
		return 0, conn.err
	}
	return uint64(clat), nil
}
示例#2
0
文件: simple.go 项目: shazow/mog
// Stream.Latency returns the playback latency in microseconds.
func (s *Stream) Latency() (uint64, error) {
	var err C.int
	lat := C.pa_simple_get_latency(s.simple, &err)
	if err == C.PA_OK {
		return uint64(lat), nil
	}
	return uint64(lat), errorFromCode(err)
}