Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Stencyl Essentials

You're reading from   Stencyl Essentials Build beautiful, unique, cross-platform games rapidly with the free Stencyl 2D game engine and toolset

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher
ISBN-13 9781784399450
Length 206 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Richard Sneyd Richard Sneyd
Author Profile Icon Richard Sneyd
Richard Sneyd
Arrow right icon
View More author details
Toc

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,...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image