Exemplo n.º 1
0
func (s *Stream) Close() error {
	if !s.closed {
		s.closed = true
		err := C.Pa_Terminate()
		if err != C.paNoError {
			return newError(err)
		}
	}
	return nil
}
Exemplo n.º 2
0
// Terminate deallocates all resources allocated by PortAudio
// since it was initialized by a call to Initialize().
//
// In cases where Initialize() has been called multiple times,
// each call must be matched with a corresponding call to Pa_Terminate().
// The final matching call to Pa_Terminate() will automatically
// close any PortAudio streams that are still open..
//
// Terminate MUST be called before exiting a program which uses PortAudio.
// Failure to do so may result in serious resource leaks, such as audio devices
// not being available until the next reboot.
func Terminate() error {
	paErr := C.Pa_Terminate()
	if paErr != C.paNoError {
		return newError(paErr)
	}
	initialized--
	if initialized <= 0 {
		initialized = 0
		cached = false
	}
	return nil
}
Exemplo n.º 3
0
func Release() {
	C.Pa_Terminate()
}
Exemplo n.º 4
0
// Terminate function as declared in portaudio/portaudio.h:151
func Terminate() Error {
	__ret := C.Pa_Terminate()
	__v := (Error)(__ret)
	return __v
}