Пример #1
0
Файл: alc.go Проект: nzlov/goal
/*
 * Capture functions
 */
func CaptureOpenDevice(devicename string, frequency int, format ALCenum, buffersize int) *Device {
	s := alcString(devicename)
	d := (*Device)(C.alcCaptureOpenDevice(
		s, C.ALCuint(frequency), C.ALCenum(format), C.ALCsizei(buffersize)))
	freeString(s)
	return d
}
Пример #2
0
func CaptureOpenDevice(name string, freq uint32, format Format, size uint32) *CaptureDevice {
	// TODO: turn empty string into nil?
	// TODO: what about an error return?
	p := C.CString(name)
	h := C.walcCaptureOpenDevice(p, C.ALCuint(freq), C.ALCenum(format), C.ALCsizei(size))
	C.free(unsafe.Pointer(p))
	return &CaptureDevice{Device{h}, uint32(format.SampleSize())}
}
Пример #3
0
func CaptureOpenDevice(name string, freq uint32, format uint32, size uint32) *CaptureDevice {
	// TODO: turn empty string into nil?
	// TODO: what about an error return?
	p := C.CString(name)
	h := C.walcCaptureOpenDevice(p, C.ALCuint(freq), C.ALCenum(format), C.ALCsizei(size))
	C.free(unsafe.Pointer(p))
	s := map[uint32]uint32{FormatMono8: 1, FormatMono16: 2, FormatStereo8: 2, FormatStereo16: 4}[format]
	return &CaptureDevice{Device{h}, s}
}