🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
6.7 KiB

  1. OpenAL Soft's renderer has advanced quite a bit since its start with panned
  2. stereo output. Among these advancements is support for surround sound output,
  3. using psychoacoustic modeling and more accurate plane wave reconstruction. The
  4. concepts in use may not be immediately obvious to people just getting into 3D
  5. audio, or people who only have more indirect experience through the use of 3D
  6. audio APIs, so this document aims to introduce the ideas and purpose of
  7. Ambisonics as used by OpenAL Soft.
  8. What Is It?
  9. ===========
  10. Originally developed in the 1970s by Michael Gerzon and a team others,
  11. Ambisonics was created as a means of recording and playing back 3D sound.
  12. Taking advantage of the way sound waves propogate, it is possible to record a
  13. fully 3D soundfield using as few as 4 channels (or even just 3, if you don't
  14. mind dropping down to 2 dimensions like many surround sound systems are). This
  15. representation is called B-Format. It was designed to handle audio independent
  16. of any specific speaker layout, so with a proper decoder the same recording can
  17. be played back on a variety of speaker setups, from quadraphonic and hexagonal
  18. to cubic and other periphonic (with height) layouts.
  19. Although it was developed decades ago, various factors held ambisonics back
  20. from really taking hold in the consumer market. However, given the solid
  21. theories backing it, as well as the potential and practical benefits on offer,
  22. it continued to be a topic of research over the years, with improvements being
  23. made over the original design. One of the improvements made is the use of
  24. Spherical Harmonics to increase the number of channels for greater spatial
  25. definition. Where the original 4-channel design is termed as "First-Order
  26. Ambisonics", or FOA, the increased channel count through the use of Spherical
  27. Harmonics is termed as "Higher-Order Ambisonics", or HOA. The details of higher
  28. order ambisonics are out of the scope of this document, but know that the added
  29. channels are still independent of any speaker layout, and aim to further
  30. improve the spatial detail for playback.
  31. Today, the processing power available on even low-end computers means real-time
  32. Ambisonics processing is possible. Not only can decoders be implemented in
  33. software, but so can encoders, synthesizing a soundfield using multiple panned
  34. sources, thus taking advantage of what ambisonics offers in a virtual audio
  35. environment.
  36. How Does It Help?
  37. =================
  38. Positional sound has come a long way from pan-pot stereo (aka pair-wise).
  39. Although useful at the time, the issues became readily apparent when trying to
  40. extend it for surround sound. Pan-pot doesn't work as well for depth (front-
  41. back) or vertical panning, it has a rather small "sweet spot" (the area the
  42. head needs to be in to perceive the sound in its intended direction), and it
  43. misses key distance-related details of sound waves.
  44. Ambisonics takes a different approach. It uses all available speakers to help
  45. localize a sound, and it also takes into account how the brain localizes low
  46. frequency sounds compared to high frequency ones -- a so-called psychoacoustic
  47. model. It may seem counter-intuitive (if a sound is coming from the front-left,
  48. surely just play it on the front-left speaker?), but to properly model a sound
  49. coming from where a speaker doesn't exist, more needs to be done to construct a
  50. proper sound wave that's perceived to come from the intended direction. Doing
  51. this creates a larger sweet spot, allowing the perceived sound direction to
  52. remain correct over a larger area around the center of the speakers.
  53. In addition, Ambisonics can encode the near-field effect of sounds, effectively
  54. capturing the sound distance. The near-field effect is a subtle low-frequency
  55. boost as a result of wave-front curvature, and properly compensating for this
  56. occuring with the output speakers (as well as emulating it with a synthesized
  57. soundfield) can create an improved sense of distance for sounds that move near
  58. or far.
  59. How Is It Used?
  60. ===============
  61. As a 3D audio API, OpenAL is tasked with playing 3D sound as best it can with
  62. the speaker setup the user has. Since the OpenAL API does not explicitly handle
  63. the output channel configuration, it has a lot of leeway in how to deal with
  64. the audio before it's played back for the user to hear. Consequently, OpenAL
  65. Soft (or any other OpenAL implementation that wishes to) can render using
  66. Ambisonics and decode the ambisonic mix for a high level of accuracy over what
  67. simple pan-pot could provide.
  68. When given an appropriate decoder configuration for the channel layout, the
  69. ambisonic mix can be decoded utilizing the benefits available to ambisonic
  70. processing, including frequency-dependent processing and near-field effects.
  71. Without a decoder configuration, the ambisonic mix can still be decoded for
  72. good stereo or surround sound output, although without near-field effects as
  73. there's no speaker distance information.
  74. In addition to surround sound output, Ambisonics also has benefits with stereo
  75. output. 2-channel UHJ is a stereo-compatible format that encodes some surround
  76. sound information using a wide-band 90-degree phase shift filter. This is
  77. generated by taking the ambisonic mix and deriving a front-stereo mix with
  78. with the rear sounds filtered in with it. Although the result is not as good as
  79. 3-channel (2D) B-Format, it has the distinct advantage of only using 2 channels
  80. and being compatible with stereo output. This means it will sound just fine
  81. when played as-is through a normal stereo device, or it may optionally be fed
  82. to a properly configured surround sound receiver which can extract the encoded
  83. information and restore some of the original surround sound signal.
  84. What Are Its Limitations?
  85. =========================
  86. As good as Ambisonics is, it's not a magic bullet that can overcome all
  87. problems. One of the bigger issues it has is dealing with irregular speaker
  88. setups, such as 5.1 surround sound. The problem mainly lies in the imbalanced
  89. speaker positioning -- there are three speakers within the front 60-degree area
  90. (meaning only 30-degree gaps in between each of the three speakers), while only
  91. two speakers cover the back 140-degree area, leaving 80-degree gaps on the
  92. sides. It should be noted that this problem is inherent to the speaker layout
  93. itself; there isn't much that can be done to get an optimal surround sound
  94. response, with ambisonics or not. It will do the best it can, but there are
  95. trade-offs between detail and accuracy.
  96. Another issue lies with HRTF. While it's certainly possible to play an
  97. ambisonic mix using HRTF and retain a sense of 3D sound, doing so with a high
  98. degree of spatial detail requires a fair amount of resources, in both memory
  99. and processing time. And even with it, mixing sounds with HRTF directly will
  100. still be better for positional accuracy.