// SetDistance // (https://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer_81.html) func SetDistance(channel int, distance uint8) error { _channel := (C.int)(channel) _distance := (C.Uint8)(distance) if (C.Mix_SetDistance(_channel, _distance)) == 0 { return sdl.GetError() } return nil }
func SetDistance(channel int, distance uint8) bool { _channel := (C.int)(channel) _distance := (C.Uint8)(distance) return int(C.Mix_SetDistance(_channel, _distance)) == 0 }
// Set the "distance" of a channel. (distance) is an integer from 0 to 255 // that specifies the location of the sound in relation to the listener. // Distance 0 is overlapping the listener, and 255 is as far away as possible // A distance of 255 does not guarantee silence; in such a case, you might // want to try changing the chunk's volume, or just cull the sample from the // mixing process with Mix_HaltChannel(). // For efficiency, the precision of this effect may be limited (distances 1 // through 7 might all produce the same effect, 8 through 15 are equal, etc). // (distance) is an integer between 0 and 255 that specifies the space // between the sound and the listener. The larger the number, the further // away the sound is. // Setting (distance) to 0 unregisters this effect, since the data would be // unchanged. // returns zero if error, nonzero if position effect is enabled. // Error messages can be retrieved from Mix_GetError(). func SetDistance(channel int, distance uint8) (int) { return int(C.Mix_SetDistance(C.int(channel), C.Uint8(distance))) }