Skip to content

7. Fading Sounds with JSAM

Brogrammist edited this page Jun 7, 2020 · 3 revisions

This guide assumes that you have set up AudioManager and have generated it's Audio Library already. If you'd like to bring yourself up to speed, you can read up on Getting Started with JSAM and Playing Your Sounds

Intro to Fading

Do you happen to have a sound that cuts off really fast near the end or is especially jarring at the beginning? JSAM let's you add fade-ins and fade-outs to your sound! These fade effects are applied during runtime and do not alter your sound file itself.

Fade Tools Overview

To enable fading in your Audio File Object, you'll want to start by selecting your Audio File Object in the inspector, locating the Fade Mode setting near the bottom, and changing it to one of three different modes.

Fade Modes

  • None - Disables fading for this Audio File Object
  • Fade In - Sound will fade in from nothing over a certain period of time when played
  • Fade Out - Sound will fade out to nothing for a certain period of time when played
  • Fade In And Out Sound will fade in, and once faded in, will fade to nothing after a certain period of time

After that, expand the drop-down menus for Audio Playback Preview and Fade Tools

You can play around with how your sound fades using the Fade Tools and test it out with the Audio Playback Preview.

Clone this wiki locally