Example #1
0
File: simple.go Project: shazow/mog
// Stream.Drain blocks until all buffered data has finished playing.
func (s *Stream) Drain() (int, error) {
	var err C.int
	written := C.pa_simple_drain(s.simple, &err)
	if err == C.PA_OK {
		return int(written), nil
	}
	return int(written), errorFromCode(err)
}
Example #2
0
File: simple.go Project: kaey/pulse
// Drain waits until all written data is played by the server.
func (conn *Conn) Drain() error {
	C.pa_simple_drain(
		conn.simple,
		&conn.err.no,
	)
	if conn.err.no != C.int(0) {
		return conn.err
	}

	return nil
}