TGB/Behaviors/AudioProfile

From TDN


AudioProfile
Description:

Add this behavior to an invisible staticSprite, or one off screen.

When the level is loaded, it creates a new audioProfile.

The behavior will look in your game/data/audio folder for the audio file.

You must specify a filename with no path, and with the file extension (.wav, .ogg etc), or it will not play.

Remember each AudioProfile requires an AudioDescription, which can be shared among any number of AudioProfiles.

So be sure to create at least one of those before creating your AudioProfile(s).


NOTES:

Objects and their behaviors are loaded in the order of the scene Object Tree.

So you should have an object containing your AudioDescription behaviors placed above the AudioProfile object(s) in your Object Tree list. Remember they can each have tons of behaviors attached to them, so for most scenes you should only need one of each object (one AudioDescription and one AudioProfile container ) to handle all of your audio.

To be sure everything works correctly your scene object tree should look like this:

   * Object containing your AudioDescription Behaviors
   * Object containing your AudioProfile Behaviors
   * Other objects that can now freely use those profiles/descriptions... 

AudioProfile.zip


 Download:



Download the zip file and drag it onto the TGB window to add it to your project.



Back to Behavior Listing