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.