// 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 }
// 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) }