Пример #1
0
// Queries the mixer format. Returns (0,0,0) if audio has not been
// opened, and (frequency, format, channels) otherwise
func QuerySpec() (int, uint16, int) {
	var frequency C.int
	var format C.Uint16
	var channels C.int
	if C.Mix_QuerySpec(&frequency, &format, &channels) == 0 {
		return 0, 0, 0
	}
	return int(frequency), uint16(format), int(channels)
}
Пример #2
0
// Find out what the actual audio device parameters are.
// This function returns 1 if the audio has been opened, 0 otherwise.
// it also return the specified values
func QuerySpec() (int, int, uint16, int) {
  var ok, frequency, channels int 
  var format uint16
  pfreq := (*C.int)(unsafe.Pointer(&frequency))
  pform := (*C.Uint16)(unsafe.Pointer(&format))
  pchan := (*C.int)(unsafe.Pointer(&channels)) 
  ok    = int(C.Mix_QuerySpec(pfreq, pform, pchan))
  return ok, frequency, format, channels
}
Пример #3
0
// QuerySpec (https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_15.html)
// open is number of call to OpenAudio or 0 on error
func QuerySpec() (frequency int, format uint16, channels int, open int, err error) {
	var _frequency C.int
	var _format C.Uint16
	var _channels C.int
	if C.Mix_QuerySpec(&_frequency, &_format, &_channels) == 0 {
		err = sdl.GetError()
	}
	frequency = int(_frequency)
	format = uint16(_format)
	channels = int(_channels)
	return
}
Пример #4
0
func QuerySpec(frequency *int, format *uint16, channels *int) bool {
	_frequency := (*C.int)(unsafe.Pointer(frequency))
	_format := (*C.Uint16)(unsafe.Pointer(format))
	_channels := (*C.int)(unsafe.Pointer(channels))
	return int(C.Mix_QuerySpec(_frequency, _format, _channels)) > 0
}