Qt Spatial Audio is an add-on module that provides a rich set of QML types and C++ classes to implement sound fields in 3D space. It contains an easy to use API for positing a listener in space, adding localized sound sources around the listener and emulating virtual rooms with reverb and reflections.
If you are new to Qt Spatial Audio, the QML types can be
imported
into an application using the following statement in your
.qml
文件。
import QtQuick3D.SpatialAudio
To link against the C++ libraries, add the following to your project's
CMakeLists.txt
file. Substitute
my_project
with the name of your project.
find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)
target_link_libraries(my_project PRIVATE Qt6::SpatialAudio)
Spatial Audio Overview provides a more detailed description about how to use the different classes listed below.
The following table outlines some important QML types.
| 类型 | 描述 |
|---|---|
| AudioEngine | The engine doing the processing of the audio scene |
| SpatialSound | A sound source located in 3D space. |
| AmbientSound | A location independent stereo sound track. |
| AudioRoom | Defines a room that generates audio reverb and reflections. |
The following table outlines some important C++ Classes
| 类 | 描述 |
|---|---|
| QAudioEngine | The engine doing the processing of the audio scene |
| QSpatialSound | A sound source located in 3D space. |
| QAmbientSound | A location independent stereo sound track. |
| QAudioRoom | Defines a room that generates audio reverb and reflections. |
The Qt Spatial Audio module is available under commercial licenses from Qt 公司 。此外,它在自由软件许可下也是可用的。这些自由软件许可是 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 3 版 。见 Qt 许可 进一步了解细节。
Note that Qt Spatial Audio is not available under the GNU GPL (一般公共许可) 第 2 版 .
Furthermore, Qt Spatial Audio in Qt 6.5.1 contains third party modules under the following permissive licenses:
| Eigen, version 3.4.0 | Mozilla Public License 2.0 and BSD 3-Clause "New" or "Revised" License |
| Resonance Audio, version e225aedb5ec7 | Apache 许可 2.0 |
| pfft, version 38946c766c1a | BSD 3 条款新 (或修订) 许可 |