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.
Checking the stable version of the documentation...
AudioStreamOggVorbis
繼承: AudioStream < Resource < RefCounted < Object
用於表示 Ogg Vorbis 音訊串流的類別。
說明
AudioStreamOggVorbis 類是專用於處理 Ogg Vorbis 檔案格式的特化 AudioStream 類。它提供載入和播放 Ogg Vorbis 檔案以及管理循環和其他播放屬性的功能。更多詳細資訊可參閱 ResourceImporterOggVorbis。
該類是音訊流系統的一部分,該系統還通過 AudioStreamWAV 類支援 WAV 檔案,通過 AudioStreamMP3 類支援 MP3 檔案。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
方法
load_from_buffer(stream_data: PackedByteArray) static |
|
load_from_file(path: String) static |
屬性說明
音軌中單節的拍數。
音軌的長度,單位為節拍。音訊檔案的實際時長可能長於該屬性所指示的值。它定義了音訊用於循環播放、AudioStreamPlaylist 和 AudioStreamInteractive 時的結束點。
音軌的拍速,以每分鐘節拍數計量。
如果為 true,則當音訊流播放至音軌末尾,或者根據 beat_count 指定的節拍數播放至最後一個節拍的末尾時,它將從 loop_offset 指定的位置重新開始播放。適用於環境音效和背景音樂。
迴圈後串流重新開始的時間(秒)。
OggPacketSequence packet_sequence 🔗
void set_packet_sequence(value: OggPacketSequence)
OggPacketSequence get_packet_sequence()
包含此串流的原始 Ogg 資料。
Dictionary tags = {} 🔗
void set_tags(value: Dictionary)
Dictionary get_tags()
若在 Ogg Vorbis 資料中找到,則包含使用者自訂的標籤。
常見標籤包括 title、artist、album、tracknumber 與 date(date 沒有統一的日期格式)。
注意: 並非所有檔案都保證具有這些標籤,因此請務必考慮鍵值可能不存在的情況。
方法說明
AudioStreamOggVorbis load_from_buffer(stream_data: PackedByteArray) static 🔗
從指定的緩衝區建立新的 AudioStreamOggVorbis 實例。緩衝區必須包含 Ogg Vorbis 資料。
AudioStreamOggVorbis load_from_file(path: String) static 🔗
從指定的檔案路徑建立新的 AudioStreamOggVorbis 實例。該檔案必須為 Ogg Vorbis 格式。