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 格式。