Voice.cs

v4.0

Any object or character that is meant to "speak" in your project using this module should have a Voice variable.

Public methods

PlayClip()

Given an AudioSource, this will call PlayOneShot() with the line provided, or if emotionName is not empty, the emotion attached to the line. If the index is not -1, a specific clip will be used, otherwise a random clip will be retrieved. This is a good general-use method to use to play the audio clips.

PlayClip(AudioSource audioSource, string line
    , string emotionName = "", int index = -1)

GetAudioClip()

This will return an AudioClip with the line provided, or if emotionName is not empty, the emotion attached to the line. If the index is not -1, a specific clip will be used, otherwise a random clip will be retrieved. This is useful for creating your own "PlayClip" method with unique characteristics for your project.

GetAudioClip(string lineName, string emotionName = "", int index = -1)

Last updated