Esempio n. 1
0
func MixAudioFormat(dst, src *uint8, format AudioFormat, len_ uint32, volume int) {
	_dst := (*C.Uint8)(unsafe.Pointer(dst))
	_src := (*C.Uint8)(unsafe.Pointer(src))
	_format := (C.SDL_AudioFormat)(format)
	_len := (C.Uint32)(len_)
	_volume := (C.int)(volume)
	C.SDL_MixAudioFormat(_dst, _src, _format, _len, _volume)
}
Esempio n. 2
0
func MixAudioFormat(dst, src []byte, f AudioFormat, vol int) error {
	if len(dst) != len(src) {
		return errors.New("len(dst) != len(src)")
	}

	C.SDL_MixAudioFormat(
		(*C.Uint8)(unsafe.Pointer(&dst[0])),
		(*C.Uint8)(unsafe.Pointer(&src[0])),
		C.SDL_AudioFormat(f),
		C.Uint32(len(dst)),
		C.int(vol),
	)

	return nil
}
Esempio n. 3
0
// MixAudioFormat (https://wiki.libsdl.org/SDL_MixAudioFormat)
func MixAudioFormat(dst, src *uint8, format AudioFormat, len_ uint32, volume int) {
	_dst := (*C.Uint8)(unsafe.Pointer(dst))
	_src := (*C.Uint8)(unsafe.Pointer(src))
	C.SDL_MixAudioFormat(_dst, _src, format.c(), C.Uint32(len_), C.int(volume))
}
Esempio n. 4
0
func MixAudioFormat(dst, src []byte, format AudioFormat, volume int) {
	C.SDL_MixAudioFormat((*C.Uint8)(unsafe.Pointer(&dst[0])), (*C.Uint8)(unsafe.Pointer(&src[0])), C.SDL_AudioFormat(int(format)), C.Uint32(len(dst)), C.int(volume))
}