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 音訊串流的類別。
說明
The AudioStreamOggVorbis class is a specialized AudioStream for handling Ogg Vorbis file formats. It offers functionality for loading and playing back Ogg Vorbis files, as well as managing looping and other playback properties. More info can be found in ResourceImporterOggVorbis.
This class is part of the audio stream system, which also supports WAV files through the AudioStreamWAV class, and MP3 files through the AudioStreamMP3 class.
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
方法
load_from_buffer(stream_data: PackedByteArray) static |
|
load_from_file(path: String) static |
屬性說明
The number of beats within a single bar in the audio track.
The length of the audio track, in beats. The actual duration of the audio file might be longer than what is indicated by this property. It defines the end of the audio for looping, AudioStreamPlaylist, and AudioStreamInteractive.
The tempo of the audio track, measured in beats per minute.
If true, the stream will play again from the specified loop_offset once it reaches the end of the audio track, or once it reaches the end of the last beat according to the amount specified in beat_count. Useful for ambient sounds and background music.
迴圈後串流重新開始的時間(秒)。
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 格式。