SNDBAL

From QB64 Wiki
Revision as of 22:24, 28 August 2009 by imported>Clippy (Created page with ''''_SNDBAL''' Sets the balance/3D position of a sound. ''Specs:'' SUB _SNDBAL (handle&,[x!],[y!],[z!]) *Attempts to position a sound in 3D space, or as close to it as the und…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

_SNDBAL Sets the balance/3D position of a sound.


Specs: SUB _SNDBAL (handle&,[x!],[y!],[z!])


  • Attempts to position a sound in 3D space, or as close to it as the underlying software libraries allow. In some cases, this will be true 3D positioning, in others, a mere volume adjustment based on distance alone.
  • x values go from left(negative) to right(positive).
  • y values go from below(negative) to above(positive).
  • z values go from behind(negative) to in front(positive).
  • Sounds at a distance of 1 or less are played at full volume.
  • Sounds further than a distance of 1000 cannot be heard.
  • The volume decreases linearly (at a constant gradient) over distance.
  • Omitted x, y or z values are set to 0.
  • By setting the x value to -1 or 1 it plays the sound at full volume from the appropriate speaker.


Example:_SNDBAL h&, -1 'sound coming from the left