AudioStreamOggVorbis

繼承: AudioStream < Resource < RefCounted < Object

用於表示 Ogg Vorbis 音訊串流的類別。

說明

AudioStreamOggVorbis 類別是專門用於處理 Ogg Vorbis 檔案格式的 AudioStream。它提供載入與播放 Ogg Vorbis 檔案的功能,並能管理循環與其他播放屬性。此類別隸屬於音訊串流系統的一部分,該系統亦透過 AudioStreamWAV 類別支援 WAV 檔案。

教學

屬性

int

bar_beats

4

int

beat_count

0

float

bpm

0.0

bool

loop

false

float

loop_offset

0.0

OggPacketSequence

packet_sequence

Dictionary

tags

{}

方法

AudioStreamOggVorbis

load_from_buffer(stream_data: PackedByteArray) static

AudioStreamOggVorbis

load_from_file(path: String) static


屬性說明

int bar_beats = 4 🔗

  • void set_bar_beats(value: int)

  • int get_bar_beats()

There is currently no description for this property. Please help us by contributing one!


int beat_count = 0 🔗

  • void set_beat_count(value: int)

  • int get_beat_count()

There is currently no description for this property. Please help us by contributing one!


float bpm = 0.0 🔗

There is currently no description for this property. Please help us by contributing one!


bool loop = false 🔗

  • void set_loop(value: bool)

  • bool has_loop()

如果為 true,音訊播放完畢後會從 loop_offset 指定的位置重新開始。適用於環境聲效與背景音樂。


float loop_offset = 0.0 🔗

  • void set_loop_offset(value: float)

  • float get_loop_offset()

迴圈後串流重新開始的時間(秒)。


OggPacketSequence packet_sequence 🔗

包含此串流的原始 Ogg 資料。


Dictionary tags = {} 🔗

若在 Ogg Vorbis 資料中找到,則包含使用者自訂的標籤。

常見標籤包括 titleartistalbumtracknumberdatedate 沒有統一的日期格式)。

注意: 並非所有檔案都保證具有這些標籤,因此請務必考慮鍵值可能不存在的情況。


方法說明

AudioStreamOggVorbis load_from_buffer(stream_data: PackedByteArray) static 🔗

從指定的緩衝區建立新的 AudioStreamOggVorbis 實例。緩衝區必須包含 Ogg Vorbis 資料。


AudioStreamOggVorbis load_from_file(path: String) static 🔗

從指定的檔案路徑建立新的 AudioStreamOggVorbis 實例。該檔案必須為 Ogg Vorbis 格式。