示例#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
文件: alc.go 项目: nzlov/goal
func (device *Device) GetIntegerv(param ALCenum, data []int32) {
	C.alcGetIntegerv(
		(*C.ALCdevice)(device),
		C.ALCenum(param),
		(C.ALCsizei)(len(data)),
		(*C.ALCint)(&data[0]),
	)
}
示例#3
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())}
}
示例#4
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}
}
示例#5
0
文件: alc.go 项目: nzlov/goal
/*
 * Query functions
 */
func (device *Device) GetString(param ALCenum) string {
	return goString(C.alcGetString((*C.ALCdevice)(device), C.ALCenum(param)))
}
示例#6
0
func (self *Device) GetInteger(param uint32) int32 {
	return int32(C.walcGetInteger(self.handle, C.ALCenum(param)))
}
示例#7
0
func (self *Device) GetIntegerv(param uint32, size uint32) (result []int32) {
	result = make([]int32, size)
	C.walcGetIntegerv(self.handle, C.ALCenum(param), C.ALCsizei(size), unsafe.Pointer(&result[0]))
	return
}