AmbientSound QML Type
立体声叠加音效。更多...
| Import Statement: | import QtQuick3D.SpatialAudio |
属性
方法
详细说明
AmbientSound 表示一种与位置和方向无关的声音。它通常用于背景声音(例如音乐),这类声音应与听者的位置和方向无关。
属性文档
autoPlay : bool
确定在指定音源时,声音是否应自动开始播放。
默认值为true 。
loops : int
确定播放器停止前声音的播放次数。设置为 QAmbienSound::Infinite 可使当前声音无限循环播放。
默认值为1 。
source : url
要播放的音频的源文件。
volume : real
定义此声源的整体音量。
方法文档
void pause()
暂停当前位置的音频播放。调用play() 可继续播放。
void play()
开始播放声音。如果声音已经在播放,则不执行任何操作。
void stop()
停止声音播放,并将当前位置和循环计数重置为0。调用play() 将从声音文件的开头开始播放。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.