Closed hai-vr closed 3 months ago
Example usage
AudioSource source = MyAudioSource();
AudioClip[] clips = MyAudioClipsWithNullValues();
AacV1.Create(new AacConfiguration())
.NewAnimatorController()
.NewLayer()
.NewState("Example")
.Audio(source, audio =>
{
// Get the PlayAudio object if there's a need to edit it directly.
VRCAnimatorPlayAudio vrcAnimatorPlayAudio = audio.PlayAudio;
// By default, a PlayAudio created through AAC does nothing (unlike a manually created behaviour)
// so you need to invoke anything that is relevant.
audio
.SelectsClip(VRC_AnimatorPlayAudio.Order.Random, clips)
.SetsLooping()
.RandomizesPitch(0.8f, 1.2f)
.RandomizesVolume(0.5f, 1f)
.StartsPlayingOnEnter()
.StopsPlayingOnExit();
});
Open draft for #2, not tested