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