AmbientSound QML Type
立体声叠加音效更多
Import Statement: | import QtQuick3D.SpatialAudio |
属性
方法
详细说明
AmbientSound 表示与位置和方向无关的声音。它通常用于背景声音(如音乐),这些声音应与听众的位置和方向无关。
属性文档
autoPlay : bool |
确定声音是否应在指定来源时自动开始播放。
默认值为true
。
loops : int |
决定播放器停止播放前声音的播放频率。设置为 QAmbienSound::Infinite 可永远循环播放当前声音。
默认值为1
。
source : url |
要播放的声音的源文件。
volume : real |
为该音源定义总音量。
方法文档
pause() |
暂停当前位置的声音播放。调用play() 将继续播放。
play() |
开始播放声音。如果声音已在播放,则不做任何操作。
stop() |
停止声音播放,并将当前位置和循环次数重置为 0。调用play() 将从声音文件的开头开始播放。
© 2025 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.