- Developed by Dented Pixel
API Docs for: LeanTween 2.26

Support LeanTween!

Show:

LeanAudioOptions Class

Defined in: LeanTween.cs:144

Pass in options to LeanAudio

Constructor

LeanAudioOptions

()

Defined in LeanTween.cs:144

Item Index

Methods

setFrequency

(
  • frequencyRate:int
)
LeanAudioOptions

Defined in LeanTween.cs:156

Set the frequency for the audio is encoded. 44100 is CD quality, but you can usually get away with much lower (or use a lower amount to get a more 8-bit sound).

Parameters:

  • frequencyRate:int Int

    of the frequency you wish to encode the AudioClip at

Returns:

LeanAudioOptions:

LeanAudioOptions describing optional values

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)} ).setFrequency(12100) );

setVibrato

(
  • vibratoArray:Vector3[]
)
LeanAudioOptions

Defined in LeanTween.cs:172

Set details about the shape of the curve by adding vibrato waves through it. You can add as many as you want to sculpt out more detail in the sound wave.

Parameters:

  • vibratoArray:Vector3[] Vector3

    The first value is the period in seconds that you wish to have the vibrato wave fluctuate at. The second value is the minimum height you wish the vibrato wave to dip down to (default is zero). The third is reserved for future effects.

Returns:

LeanAudioOptions:

LeanAudioOptions describing optional values

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,0.3f,0f)} ).setFrequency(12100) );