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...
ResourceImporterOggVorbis
繼承: ResourceImporter < RefCounted < Object
匯入 Ogg Vorbis 音訊檔案以供播放。
說明
Ogg Vorbis 為有損音訊格式,在相同位元率下相較於 ResourceImporterMP3 可提供更佳音質。
大多數情況下建議使用 Ogg Vorbis 而非 MP3。若僅有 MP3 音源且無更高品質來源,則應直接使用 MP3 以避免再次經過有損壓縮。
Ogg Vorbis 解碼所需的 CPU 資源多於 ResourceImporterWAV。若需同時播放大量聲音,特別是在低階裝置上,建議對那些聲音改用 WAV。
教學
屬性
|
||
|
||
|
||
|
||
|
方法
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. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.
A more convenient editor for bar_beats is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.
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. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.
A more convenient editor for beat_count is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.
The tempo of the audio track, measured in beats per minute. This should match the BPM measure that was used to compose the track. This is only relevant for music that wishes to make use of interactive music functionality, not sound effects.
A more convenient editor for bpm is provided in the Advanced Import Settings dialog, as it lets you preview your changes without having to reimport the audio.
If enabled, the audio will begin playing either from the beginning or from loop_offset, after playback ends by either reaching the end of the audio or reaching the end of the last beat according to the amount specified in beat_count.
Note: In AudioStreamPlayer, the AudioStreamPlayer.finished signal won't be emitted for looping audio when it reaches the end of the audio file, as the audio will keep playing indefinitely.
決定當播放到結尾後,音訊從何處開始迴圈。可僅重複音訊檔案的某一段,對部分環境音效或音樂十分實用。此值以秒為單位,從音訊開頭算起;0.0 代表整個檔案皆迴圈。
僅當 loop 為 true 時生效。
進階匯入設定 對話方塊提供了更方便的 loop_offset 編輯器,可讓你在不重新匯入音訊的情況下預覽變更。
方法說明
AudioStreamOggVorbis load_from_buffer(stream_data: PackedByteArray) static 🔗
已棄用: Use AudioStreamOggVorbis.load_from_buffer() instead.
從指定的緩衝區建立新的 AudioStreamOggVorbis 實例。緩衝區必須包含 Ogg Vorbis 資料。
AudioStreamOggVorbis load_from_file(path: String) static 🔗
已棄用: Use AudioStreamOggVorbis.load_from_file() instead.
從指定的檔案路徑建立新的 AudioStreamOggVorbis 實例。該檔案必須為 Ogg Vorbis 格式。