LeanAudio Class
Create Audio dynamically and easily playback
Constructor
LeanAudio
()
Item Index
Methods
Methods
createAudio
-
volumeCurve:AnimationCurve
-
frequencyCurve:AnimationCurve
-
options:LeanAudioOptions
Create dynamic audio from a set of Animation Curves and other options.
Parameters:
-
volumeCurve:AnimationCurve
AnimationCurvedescribing the shape of the audios volume (from 0-1). The length of the audio is dicated by the end value here.
-
frequencyCurve:AnimationCurve
AnimationCurvedescribing 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
LeanAudioOptionsYou 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 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)} ));