Example #1
0
func (s *Sample) Play(gain, pan, speed float32, loop uint32) (bool, *SampleId) {
	retId := new(C.ALLEGRO_SAMPLE_ID)
	r := bool(C.al_play_sample((*C.ALLEGRO_SAMPLE)(unsafe.Pointer(s)), C.float(gain), C.float(pan), C.float(speed), C.ALLEGRO_PLAYMODE(loop), retId))
	return r, (*SampleId)(unsafe.Pointer(retId))
}
Example #2
0
File: audio.go Project: beoran/algo
// Plays a sample on the default mixer if enough samples have been reserved.
// id returns a sample if that can be used to track the sample.
func (self *Sample) Play(gain, pan, speed float32, loop PlayMode) (ok bool, id SampleId) {
	ok = cb2b(C.al_play_sample(self.handle, C.float(gain), C.float(pan), C.float(speed), loop.toC(), (&id).toC()))
	return ok, id
}