Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioStreamPlaylist

繼承: AudioStream < Resource < RefCounted < Object

包含子串流並以播放清單方式播放的 AudioStream

說明

An audio stream that can play back sub-streams in sequence. Streams can be added to the Playlist with set_list_stream(), and shuffled with shuffle.

教學

屬性

float

fade_time

0.3

bool

loop

true

bool

shuffle

false

int

stream_count

0

方法

float

get_bpm() const

AudioStream

get_list_stream(stream_index: int) const

void

set_list_stream(stream_index: int, audio_stream: AudioStream)


常數

MAX_STREAMS = 64 🔗

播放清單可支援的最大串流數量。


屬性說明

float fade_time = 0.3 🔗

  • void set_fade_time(value: float)

  • float get_fade_time()

當一個串流結束並轉到下一個時所使用的淡出時間。建議各串流在結尾保留些許額外音訊以利淡出。


bool loop = true 🔗

  • void set_loop(value: bool)

  • bool has_loop()

若為 true,播放清單將循環播放;否則在最後一個串流播放完畢後停止。


bool shuffle = false 🔗

  • void set_shuffle(value: bool)

  • bool get_shuffle()

若為 true,每次開始播放或重新循環時播放清單將重新隨機排序。


int stream_count = 0 🔗

  • void set_stream_count(value: int)

  • int get_stream_count()

播放清單中的串流數量。


方法說明

float get_bpm() const 🔗

返回播放清單的 BPM,可能隨目前播放的片段而異。


AudioStream get_list_stream(stream_index: int) const 🔗

返回指定播放位置索引處的串流。


void set_list_stream(stream_index: int, audio_stream: AudioStream) 🔗

設定指定播放位置索引處的串流。