This is an audio stream that can playback music interactively, combining clips and a transition table. Clips must be added first, and then the transition rules via the [method add_transition]. Additionally, this stream exports a property parameter to control the playback via [AudioStreamPlayer], [AudioStreamPlayer2D], or [AudioStreamPlayer3D].
The way this is used is by filling a number of clips, then configuring the transition table. From there, clips are selected for playback and the music will smoothly go from the current to the new one while using the corresponding transition rule defined in the transition table.
Add a transition between two clips. Provide the indices of the source and destination clips, or use the [constant CLIP_ANY] constant to indicate that transition happens to/from any clip to this one.
* [param from_time] indicates the moment in the current clip the transition will begin after triggered.
* [param to_time] indicates the time in the next clip that the playback will start from.
* [param fade_mode] indicates how the fade will happen between clips. If unsure, just use [constant FADE_AUTOMATIC] which uses the most common type of fade for each situation.
* [param fade_beats] indicates how many beats the fade will take. Using decimals is allowed.
* [param use_filler_clip] indicates that there will be a filler clip used between the source and destination clips.
* [param filler_clip] the index of the filler clip.
* If [param hold_previous] is used, then this clip will be remembered. This can be used together with [constant AUTO_ADVANCE_RETURN_TO_HOLD] to return to this clip after another is done playing.
</description>
</method>
<methodname="erase_transition">
<returntype="void"/>
<paramindex="0"name="from_clip"type="int"/>
<paramindex="1"name="to_clip"type="int"/>
<description>
Erase a transition by providing [param from_clip] and [param to_clip] clip indices. [constant CLIP_ANY] can be used for either argument or both.
Set the index of the next clip towards which this clip will auto advance to when finished. If the clip being played loops, then auto-advance will be ignored.
</description>
</method>
<methodname="set_clip_name">
<returntype="void"/>
<paramindex="0"name="clip_index"type="int"/>
<paramindex="1"name="name"type="StringName"/>
<description>
Set the name of the current clip (for easier identification).
</description>
</method>
<methodname="set_clip_stream">
<returntype="void"/>
<paramindex="0"name="clip_index"type="int"/>
<paramindex="1"name="stream"type="AudioStream"/>
<description>
Set the [AudioStream] associated with the current clip.
Transition to the same position in the destination clip. This is useful when both clips have exactly the same length and the music should fade between them.