getAbsorption.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. return {
  2. summary = 'Get the absorption coefficients.',
  3. description = [[
  4. Returns the global air absorption coefficients for the medium. This affects Sources that have
  5. the `absorption` effect enabled, causing audio volume to drop off with distance as it is
  6. absorbed by the medium it's traveling through (air, water, etc.). The difference between
  7. absorption and the attenuation effect is that absorption is more subtle and is
  8. frequency-dependent, so higher-frequency bands can get absorbed more quickly than lower ones.
  9. This can be used to apply "underwater" effects and stuff.
  10. ]],
  11. arguments = {},
  12. returns = {
  13. low = {
  14. type = 'number',
  15. description = 'The absorption coefficient for the low frequency band.'
  16. },
  17. mid = {
  18. type = 'number',
  19. description = 'The absorption coefficient for the mid frequency band.'
  20. },
  21. high = {
  22. type = 'number',
  23. description = 'The absorption coefficient for the high frequency band.'
  24. }
  25. },
  26. variants = {
  27. {
  28. arguments = {},
  29. returns = { 'low', 'mid', 'high' }
  30. }
  31. },
  32. notes = [[
  33. Absorption is currently only supported by the phonon spatializer.
  34. The frequency bands correspond to `400Hz`, `2.5KHz`, and `15KHz`.
  35. The default coefficients are `.0002`, `.0017`, and `.0182` for low, mid, and high.
  36. ]]
  37. }