Example #1
0
File: simple.go Project: shazow/mog
// Stream.Flush flushes the playback buffer, discarding any audio therein
func (s *Stream) Flush() (int, error) {
	var err C.int
	flushed := C.pa_simple_flush(s.simple, &err)
	if err == C.PA_OK {
		return int(flushed), nil
	}
	return int(flushed), errorFromCode(err)
}
Example #2
0
File: simple.go Project: kaey/pulse
// Flush discards all data in the server buffer.
func (conn *Conn) Flush() error {
	C.pa_simple_flush(
		conn.simple,
		&conn.err.no,
	)
	if conn.err.no != C.int(0) {
		return conn.err
	}

	return nil
}