Esempio n. 1
0
File: ao.go Progetto: k19k/go-ao
func (device *Device) Play16(samples []int16) bool {
	raw := (*C.char)(unsafe.Pointer(&samples[0]))
	num := C.uint_32(len(samples) * 2)
	return C.ao_play(device.ao, raw, num) != 0
}
Esempio n. 2
0
File: ao.go Progetto: bobertlo/go-ao
// FIXME: handle errors
func (p *Player) Play(buf []byte) {
	C.ao_play(p.handle, (*C.char)(unsafe.Pointer(&buf[0])), C.uint_32(len(buf)))
}