audio.html 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]--><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Asciidoctor 1.5.4"><meta name="keywords" content="sound, documentation, environment"><title>Audio in jME3</title><link rel="stylesheet" href="./asciidoctor.css">
  2. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
  3. <link rel="stylesheet" href="./coderay-asciidoctor.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css"><link rel="stylesheet" href="/home/travis/build/jMonkeyEngine/wiki/build/asciidoc/html5/jme3/advanced/twemoji-awesome.css"></head><body class="article toc2 toc-left"><div id="header"><div id="toolbar"><a href="https://github.com/jMonkeyEngine/wiki/edit/master/src/docs/asciidoc/jme3/advanced/audio.adoc"><i class="fa fa-pencil-square" aria-hidden="true"></i></a><a href="https://github.com/jMonkeyEngine/wiki/new/master/src/docs/asciidoc/jme3/advanced/"><i class="fa fa-plus-square" aria-hidden="true"></i></a><input dir="auto" style="position: relative; vertical-align: top;" spellcheck="false" autocomplete="off" class="searchbox__input aa-input" id="doc-search" name="search" placeholder="Search in the doc" required="required" type="search"></div><h1>Audio in jME3</h1><div class="details"><span class="author" id="author"></span><br><span id="revnumber">version ,</span> <span id="revdate">2016/03/17 20:48</span></div><div id="toc" class="toc2"><div id="toctitle">Table of Contents</div><ul class="sectlevel1"><li><a href="#audio-terminology">Audio Terminology</a></li><li><a href="#creating-audio-nodes-streamed-or-buffered">Creating Audio Nodes: Streamed or Buffered</a></li><li><a href="#getting-audionode-properties">Getting AudioNode Properties</a></li><li><a href="#setting-audionode-properties">Setting AudioNode Properties</a><ul class="sectlevel2"><li><a href="#looping-ambient-sounds">Looping &amp; Ambient Sounds</a></li><li><a href="#positional-3d-sounds">Positional 3D Sounds</a></li><li><a href="#directional-3d-sounds">Directional 3D Sounds</a></li></ul></li><li><a href="#play-pause-stop">Play, Pause, Stop</a></li><li><a href="#the-audio-listener">The Audio Listener</a></li><li><a href="#setting-audio-environment-properties">Setting Audio Environment Properties</a></li></ul></div></div><div id="content"><div id="preamble"><div class="sectionbody"><div class="paragraph"><p>Place audio files in the <code>assets/Sound/</code> directory of your project. jME3 supports Ogg Vorbis audio compression (.ogg) and uncompressed PCM Wave (.wav) formats. You can use for example <a href="http://audacity.sourceforge.net/">Audacity</a> to convert from other formats.</p></div></div></div>
  4. <div class="sect1"><h2 id="audio-terminology">Audio Terminology</h2><div class="sectionbody"><div class="ulist"><ul><li><p><strong>Streaming:</strong> There are two ways to load audio data: Short audio files are to be stored entirely in memory (prebuffered), while long audio files, such as music, are streamed from the hard drive as it is played.</p></li><li><p><strong>Looping:</strong> You can play a sound either once and then stop, or repeatedly (continuously) in a loop.<br>
  5. You cannot loop streamed sounds.</p></li><li><p><strong>Instance:</strong> If you play the same audio twice, the playing is queued up and jME plays one after the other. If you play instances of sounds, several instances of the same sound can play at the same time.</p></li></ul></div></div></div>
  6. <div class="sect1"><h2 id="creating-audio-nodes-streamed-or-buffered">Creating Audio Nodes: Streamed or Buffered</h2><div class="sectionbody"><div class="paragraph"><p>The main jME audio class to look at is <code>com.jme3.audio.AudioNode</code>. When creating a new audio node you need to declare whether how you want to load this sound:</p></div>
  7. <div class="ulist"><ul><li><p><strong>Buffered:</strong> By default, a new audio node is buffered. This means jME3 loads the whole file into memory before playing. Use this for short sounds. You create a buffered sound by setting DataType.Buffer, or using no DataType at all:</p></li></ul></div>
  8. <div class="listingblock"><div class="content"><pre>AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav");
  9. AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav", DataType.Buffer);</pre></div></div>
  10. <div class="ulist"><ul><li><p><strong>Streamed:</strong> If it is a long file such as music or a dialog, you stream the audio. Streaming means, you load and play in parallel until the sound is done. You cannot loop streams. You create a streamed sound by setting the boolean to true:</p></li></ul></div>
  11. <div class="listingblock"><div class="content"><pre>AudioNode music = new AudioNode(assetManager, "Sound/music.wav", DataType.Stream);</pre></div></div></div></div>
  12. <div class="sect1"><h2 id="getting-audionode-properties">Getting AudioNode Properties</h2><div class="sectionbody"><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AudioNode Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getStatus()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns either AudioSource.Status.Playing, AudioSource.Status.Stopped, or AudioSource.Status.Paused.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getVolume()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns the volume.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>getPitch()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Returns the pitch.</p></div></div></td></tr></tbody></table>
  13. <div class="admonitionblock note"><table><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content"><div class="paragraph"><p>There are other obvious getters to poll the status of all corresponding setters listed here.</p></div></td></tr></table></div></div></div>
  14. <div class="sect2"><h3 id="setting-audionode-properties">Setting AudioNode Properties</h3><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AudioNode Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setTimeOffset(0.5f)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Play the sound starting at a 0.5 second offset from the beginning. Default is 0.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setPitch(1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Makes the sound play in a higher or lower pitch. Default is 1. 2 is twice as high, .5f is half as high.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setVolume(1)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Sets the volume gain. 1 is the default volume, 2 is twice as loud, etc. 0 is silent/mute.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setRefDistance(50f)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The reference distance controls how far a sound can still be heard at 50% of its original volume (<em>this is assuming an exponential fall-off!</em>). A sound with a high RefDist can be heard loud over wide distances; a sound with a low refDist can only be heard when the listener is close by. Default is 10 world units.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setMaxDistance(100f)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>The 'maximum attenuation distance' specifies how far from the source the sound stops growing more quiet (sounds in nature don&#8217;t do that). Set this to a smaller value to keep the sound loud even at a distance; set this to higher value to let the sound fade out quickly. Default is 20 world units.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setLooping(false)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Configures the sound so that, if it is played, it plays once and stops. No looping is the default.</p></div></div></td></tr></tbody></table>
  15. <div class="sect2"><h3 id="looping-ambient-sounds">Looping &amp; Ambient Sounds</h3><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AudioNode Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setPositional(false)<br>
  16. setDirectional(false)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>All 3D effects switched off. This sound is global and plays in headspace (it appears to come from everywhere). Good for environmental ambient sounds and background music.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setLooping(true)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Configures the sound to be a loop: After the sound plays, it repeats from the beginning, until you call stop() or pause(). Good for music and ambient background noises.<br>
  17. <strong>Before 3.1-alpha2, Looping does not work on streamed sounds.</strong></p></div></div></td></tr></tbody></table></div>
  18. <div class="sect2"><h3 id="positional-3d-sounds">Positional 3D Sounds</h3><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AudioNode Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setPositional(true)<br>
  19. setLocalTranslation(…)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Activates 3D audio: The sound appears to come from a certain position, where it is loudest. Position the AudioNode in the 3D scene, or move it with mobile players or NPCs.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setReverbEnabled(true)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Reverb is a 3D echo effect that only makes sense with positional AudioNodes. Use Audio Environments to make scenes sound as if they were &#8220;outdoors&#8221;, or &#8220;indoors&#8221; in a large or small room, etc. The reverb effect is defined by the <code>com.jme3.audio.Environment</code> that the <code>audioRenderer</code> is in. See &#8220;Setting Audio Environment Properties&#8221; below.</p></div></div></td></tr></tbody></table>
  20. <div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>Positional 3D sounds require an <code>AudioListener</code> object in the scene (representing the player&#8217;s ears).</p></div></td></tr></table></div></div>
  21. <div class="sect2"><h3 id="directional-3d-sounds">Directional 3D Sounds</h3><table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 50%;"><col style="width: 50%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">AudioNode Method</th><th class="tableblock halign-left valign-top">Usage</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setDirectional(true)<br>
  22. setDirection(…)</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Activates 3D audio: This sound can only be heard from a certain direction. Specify the direction and angle in the 3D scene if you have setDirectional() true. Use this to restrict noises that should not be heard, for example, through a wall.</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>setInnerAngle()<br>
  23. setOuterAngle()</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Set the angle in degrees for the directional audio. The angle is relative to the direction. Note: By default, both angles are 360° and the sound can be heard from all directions!</p></div></div></td></tr></tbody></table>
  24. <div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>Directional 3D sounds require an AudioListener object in the scene (representing the player&#8217;s ears).</p></div></td></tr></table></div></div></div>
  25. <div class="sect1"><h2 id="play-pause-stop">Play, Pause, Stop</h2><div class="sectionbody"><div class="paragraph"><p>You play, pause, and stop a node called myAudioNode by using the respective of the following three methods:</p></div>
  26. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">myAudioNode.play();</code></pre></div></div>
  27. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">myAudioNode.pause();</code></pre></div></div>
  28. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">myAudioNode.stop();</code></pre></div></div>
  29. <div class="admonitionblock note"><table><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content"><div class="paragraph"><p>Whether an Audio Node plays continuously or only once, depends on the Loop properties you have set above!</p></div></td></tr></table></div>
  30. <div class="paragraph"><p>You can also start playing instances of an AudioNode. Use the <code>playInstance()</code> method if you need to play the same AudioNode multiple times, possibly simulatenously. Note that changes to the parameters of the original AudioNode do not affect the instances that are already playing!</p></div>
  31. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">myAudioNode.playInstance();</code></pre></div></div></div></div>
  32. <div class="sect1"><h2 id="the-audio-listener">The Audio Listener</h2><div class="sectionbody"><div class="paragraph"><p>The default AudioListener object <code>listener</code> in <code>SimpleApplication</code> is the user&#8217;s ear in the scene. If you use 3D audio (positional or directional sounds), you must move the AudioListener with the player: For example, for a first-person player, you move the listener with the camera. For a third-person player, you move the listener with the player avatar Geometry.</p></div>
  33. <div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java"> <span class="annotation">@Override</span>
  34. <span class="directive">public</span> <span class="type">void</span> simpleUpdate(<span class="type">float</span> tpf) {
  35. <span class="comment">// first-person: keep the audio listener moving with the camera</span>
  36. listener.setLocation(cam.getLocation());
  37. listener.setRotation(cam.getRotation());
  38. }</code></pre></div></div></div></div>
  39. <div class="sect1"><h2 id="setting-audio-environment-properties">Setting Audio Environment Properties</h2><div class="sectionbody"><div class="paragraph"><p>Optionally, You can choose from the following environmental presets from <code>com.jme3.audio.Environment</code>. This presets influence subtle echo effects (reverb) that evoke associations of different environments in your users. That is, it makes you scene sound &#8220;indoors&#8221; or &#8220;outdoors&#8221; etc. You use Audio Environments together with <code>setReverbEnabled(true)</code> on positional AudioNodes (see above).</p></div>
  40. <table class="tableblock frame-all grid-all spread"><colgroup><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.0909%;"><col style="width: 9.091%;"></colgroup><thead><tr><th class="tableblock halign-left valign-top">Environment</th><th class="tableblock halign-left valign-top">density</th><th class="tableblock halign-left valign-top">diffusion</th><th class="tableblock halign-left valign-top">gain</th><th class="tableblock halign-left valign-top">gainHf</th><th class="tableblock halign-left valign-top">decayTime</th><th class="tableblock halign-left valign-top">decayHf</th><th class="tableblock halign-left valign-top">reflGain</th><th class="tableblock halign-left valign-top">reflDelay</th><th class="tableblock halign-left valign-top">lateGain</th><th class="tableblock halign-left valign-top">lateDelay</th></tr></thead><tbody><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Garage</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.00f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.00f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.90f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.5f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.751f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0039f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.661f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0137f</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Dungeon</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.75f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.75f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.60f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.950f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0026f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.930f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0103f</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Cavern</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.50f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.50f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>2.25f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.908f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0103f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.930f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0410f</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>AcousticLab</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.50f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.00f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.28f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.870f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0020f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.810f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0080f</p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>Closet</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.00f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.00f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.15f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>1.0f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.600f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0025f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.500f</p></div></div></td><td class="tableblock halign-left valign-top"><div><div class="paragraph"><p>0.0006f</p></div></div></td></tr></tbody></table>
  41. <div class="olist arabic"><ol class="arabic"><li><p>Activate a Environment preset</p><div class="ulist"><ul><li><p>Either use a default, e.g. make you scene sounds like a dungeon environment:</p><div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">audioRenderer.setEnvironment(<span class="keyword">new</span> Environment(Environment.Dungeon));</code></pre></div></div></li><li><p>Or activate <a href="../../jme3/advanced/audio_environment_presets.html">custom environment settings</a> in the Environment constructor:</p><div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">audioRenderer.setEnvironment(
  42. <span class="keyword">new</span> Environment( density, diffusion, gain, gainHf, decayTime, decayHf,
  43. reflGain, reflDelay, lateGain, lateDelay ) );</code></pre></div></div></li></ul></div></li><li><p>Activate 3D audio for certain sounds:</p><div class="listingblock"><div class="content"><pre class="CodeRay highlight"><code data-lang="java">footstepsAudio.setPositional(<span class="predefined-constant">true</span>);
  44. footstepsAudio.setReverbEnabled(<span class="predefined-constant">true</span>);</code></pre></div></div></li></ol></div>
  45. <div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>A sound engineer can create a custom <code>com.​jme3.​audio.Environment</code> object and specify custom environment values such as density, diffusion, gain, decay, delay… You can find many <a href="../../jme3/advanced/audio_environment_presets.html">examples of custom audio environment presets</a> here.</p></div></td></tr></table></div>
  46. <div class="paragraph"><p>Advanced users find more info about OpenAL and its features here: <a href="http://web.archive.org/web/20130327063429/http://connect.creativelabs.com/openal/Documentation/OpenAL_Programmers_Guide.pdf">OpenAL 1.1 Specification</a>.</p></div>
  47. <div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>It depends on the hardware whether audio effects are supported (if not, you get the message <code>OpenAL EFX not available! Audio effects won&#8217;t work.</code>)</p></div></td></tr></table></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2019-12-20 23:30:51 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
  48. apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
  49. indexName: 'jmonkeyengine',
  50. inputSelector: '#doc-search',
  51. debug: false // Set debug to true if you want to inspect the dropdown
  52. });</script></body></html>