Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using a positional audio and environmental effects


Audio is an incredibly powerful mood setter and should not be overlooked in a game. In this recipe, we'll go through how to make the most of your sound assets using runtime effects and settings. If you're simply looking for omnipresent sounds or the basics on how to play them, check out Chapter 1, SDK Game Development Hub.

This recipe will do well in an FPS, where you have a number of footstep sounds that are played when the player moves around. However, the principle is true for any short sound that is played often enough to sound repetitive.

We'll approach this recipe in two steps:

  1. First, we will learn how to vary a basic, repetitive sound. We can achieve this by varying the sound's pitch and using LowPassFilter.

  2. In the second step, we'll use reverb to vary it further, depending on the scene.

How to do it...

First of all, we need some basics set up.

  1. We create a new application extending SimpleApplication, and add an AudioNode field called audioNode...