Book Image

Stencyl Essentials

By : Richard Sneyd
Book Image

Stencyl Essentials

By: Richard Sneyd

Overview of this book

Table of Contents (20 chapters)
Stencyl Essentials
About the Author
About the Reviewers

Sound file designation in Stencyl

Sounds in Stencyl must be designated as either Music or Sound FX. Why is this, you may ask? In general terms, this allows Stencyl to make certain assumptions about the size of the file, and how to treat it in memory. The audio engine logically assumes that the music files will be larger than the sound FX files, and so it loads them and keeps them in the memory for the duration of the game. Sound FX files, on the other hand, are assumed to be relatively small, and so are loaded into the memory on the fly when they are called from the code, and then removed from the memory again. All of this happens under the hood, so to speak, in an effort to improve the performance of your games, so be sure to use the correct designation for your sound files!

The whip sound we just imported is Sound FX, so let's designate it by setting the Sound Type parameter to Sound Effect, as shown in the following screenshot:

Great work! Before you trigger this sound FX in the code,...