module SFML::Listener

The “ear” — a global, single-instance object that defines from where the player hears the world. Sounds positioned via Sound#position= attenuate based on their distance from this point.

SFML::Listener.position = [400, 300, 0] # follow your camera SFML::Listener.global_volume = 80 # 0..100, master gain

For 2D games keep z = 0 and treat x, y as world coords. For first-person stuff also set Listener.direction to point along the camera forward.