WyrmTale Games
$35.00 USD
$15.00 USD
$25.00 USD
$35.00 USD
$20.00 USD
$35.00 USD
Navigation : www.wyrmtale.com / orthello / sounds
Search :
search

Orthello Sounds

| User Guide Contents | Download Orthello | C# Class Reference | Asset store link |


Sounds

Orthello has some build functionality to easily and quickly play sounds and music in your apps and games. You put all your sound clips or sound clip url references into OT.OTSounds using the property inspector. To play sounds you will use the OTSound class.

Putting your sounds into Orthello

Before you can play sounds or music you will have to provide them to Orthello. You do this by adding them to the sound clips array in OT.OTSounds in the property inspector.

An Orthello sound clip has a name that you will use in combination with OTSound to play it later. It has a clip, this is the associated Unity3d AudioClip or an url.

If you are using an url, this url will be used to load/stream your sound into unity3d using the regular unity3d sound functions. Make sure your security is setup correctly for streaming/loading sounds and if you use allowed sound files that are allowed to be streamed/loaded.

The Mute property in OTSounds, also accessable programmaticly by OT.sound.mute, is used to mute all sounds.

The Volume property in OTSounds, also accessable programmaticly by OT.sound, is used to set the base volume for all sounds.

IMPORTANT! Orthello only uses 2D sound clips. Make sure you configure your sound clips to be 2D in your project folder.

OTSound class

There are several ways to play sounds using the OTSound class.

  • Fire and Forget
    The sound is played and the OTSound object will be marked for garbage collection.
  • Store and play
    Store the OTSound and OTSound.Play() it when you need to play the sound. If this OTSound was already playing, it will be stopped and replayed.
  • Store and play threaded
    Store the OTSound and Fire and Forget a OTSound.PlayClone() when you nmeed to pluay the sound. A new OTSound object is cloned, played and will be marked for garbage collection. No sounds will be stopped.

The OTSound object has some setter methods that can be used to set certain sound properties. Because each of these methods returns the OTSound object you can create one long statement that setsup your sound.

There are the following sound setting methods :

  • OTSound.Pitch(float pitch)
    Sets the pitch of the sound
  • OTSound.Pan(float pan)
    Sets the pan of the sound
  • OTSound.Count(int count)
    Sets the number of times a sound has to be played.
  • OTSound.Volume(float volume)
    Sets the volume of the sound
  • OTSound.Delay(float delay)
    Sets the delay of the sound in seconds. The sound will be started after
    this delay.
  • OTSound.Loop()
    The sound will be played looping
  • OTSound.FadeIn(float time)
    Sets the fade in time of the sound in seconds. When the sound is started, it will fade in
    from volume 0 to its volume in fade in time.
  • OTSound.FadeOut(float time)
    Sets the fade out time of the sound in seconds. When the sound is about to stop, it will fade out
    from its volume to volume 0 in fade out time.
  • OTSound.Duration(float time)
    Sets how long this sound has to be played in seconds.

In addition to the sound setting methods we also have these usefull methods :

  • OTSound OTSound.Play(string sound)
    Plays a sound and returns the OTSound object that can be used to call the sound setting methods.
  • OTSound OTSound.PlayClone(string sound)
    Plays a sound and returns the OTSound cloned object that can be used to call the sound setting methods.
  • OTSound.isPlaying
    Indicates that the sound is playing
  • OTSound.Stop()
    Stops playing a sound
  • OTSound.Idle()
    Marks the current sound to stay idle (for now). Normaly used in combination with
    constructor to prevent the sound from playing if you would like to store it and play it later.

| Previous : Tweening |

WyrmTale Games
de Vinkenslag 22
5258 KX Berlicum (NB)
The Netherlands
info@wyrmtale.com
| Privacy Policy | Disclaimer |



WyrmTale Games is a Ruach Interactive B.V. Division.
KvK nr. 17244071 - VAT nr. NL8204.66.633.B01
 
Inline