Exemple #1
0
/*
 * 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
}
Exemple #2
0
func (device *Device) GetIntegerv(param ALCenum, data []int32) {
	C.alcGetIntegerv(
		(*C.ALCdevice)(device),
		C.ALCenum(param),
		(C.ALCsizei)(len(data)),
		(*C.ALCint)(&data[0]),
	)
}
Exemple #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())}
}
Exemple #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}
}
Exemple #5
0
/*
 * Query functions
 */
func (device *Device) GetString(param ALCenum) string {
	return goString(C.alcGetString((*C.ALCdevice)(device), C.ALCenum(param)))
}
Exemple #6
0
func (self *Device) GetInteger(param uint32) int32 {
	return int32(C.walcGetInteger(self.handle, C.ALCenum(param)))
}
Exemple #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
}