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:

Sound file designation in Stencyl

Great work! Before you trigger this sound FX in the code, let's import a music file by performing the following steps:

  1. Go to the Dashboard, as before, and create a new sound asset. Name it Country Music, and then click on Create.
  2. Click on Import MP3, then navigate to and import Game AssetsSoundsMP3Country Music.mp3.
  3. Click on Import OGG, then navigate to and import Game AssetsSoundsOGGCountry Music.ogg.
  4. Change Sound Type to Music.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.212.124