예제 #1
0
파일: alcCore.go 프로젝트: dennwc/go-openal
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())}
}
예제 #2
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}
}
예제 #3
0
파일: core.go 프로젝트: pigulon/go-openal
func CaptureOpenDevice(name string, freq int, format int, size int) (device *CaptureDevice) {
	p := C.CString(name)
	h := C.walcCaptureOpenDevice(p, C.int(freq), C.int(format), C.int(size))
	C.free(unsafe.Pointer(p))

	if h == nil {
		return
	}

	device = new(CaptureDevice)
	device.handle = h
	return
}