- Developed by Dented Pixel
API Docs for: LeanTween 2.46

Support LeanTween!

Maintaining and adding new features takes time, your support is appreciated.

Show:

LeanAudio Class

Defined in: LeanAudio.cs:30

Create Audio dynamically and easily playback

Constructor

LeanAudio

()

Defined in LeanAudio.cs:30

Item Index

Methods

Methods

createAudio

(
  • volumeCurve:AnimationCurve
  • frequencyCurve:AnimationCurve
  • options:LeanAudioOptions
)
AudioClip

Defined in LeanAudio.cs:65

Create dynamic audio from a set of Animation Curves and other options.

Parameters:

  • volumeCurve:AnimationCurve AnimationCurve

    describing the shape of the audios volume (from 0-1). The length of the audio is dicated by the end value here.

  • frequencyCurve:AnimationCurve AnimationCurve

    describing the width of the oscillations between the sound waves in seconds. Large numbers mean a lower note, while higher numbers mean a tighter frequency and therefor a higher note. Values are usually between 0.01 and 0.000001 (or smaller)

  • options:LeanAudioOptions LeanAudioOptions

    You can pass any other values in here like vibrato or the frequency you would like the sound to be encoded at. See LeanAudioOptions for more details.

Returns:

AudioClip:

AudioClip of the procedurally generated audio

Example:

AnimationCurve volumeCurve = new AnimationCurve( new Keyframe(0f, 1f, 0f, -1f), new Keyframe(1f, 0f, -1f, 0f));
AnimationCurve frequencyCurve = new AnimationCurve( new Keyframe(0f, 0.003f, 0f, 0f), new Keyframe(1f, 0.003f, 0f, 0f));
AudioClip audioClip = LeanAudio.createAudio(volumeCurve, frequencyCurve, LeanAudio.options().setVibrato( new Vector3[]{ new Vector3(0.32f,0f,0f)} ));