Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
spatialaudiooverview.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page spatialaudiooverview.html
6
\title Spatial Audio Overview
7
\brief Support for spatial audio.
8
\ingroup explanations-graphicsandmultimedia
9
10
The Qt Spatial Audio API provides a number of classes that allow the creation of
11
three dimensional sound scene. It is defined by objects located in 3D space
12
that emit sound and surrounding geometry that can be modelled using
13
one or several rooms. Finally a listener can be placed into this
14
sound scene at a specified position and orientation.
15
16
There are both C++ and QML APIs that can be used.
17
18
\section1 Creating a sound scene
19
20
To create the sound scene, one first instantiates a \l QAudioEngine. This engine
21
processes input sound data and geometries to create a realistic
22
representation of the sound scene as it would be experienced by a person placed
23
at a specific location inside the scene.
24
25
The \l QAudioEngine::OutputMode property can be used to optimize the output either
26
for headphones using binaural (virtual 3D) rendering or for a stereo or surround speaker
27
configuration.
28
29
The output device can be selected using \l QAudioEngine::outputDevice property.
30
31
Once the engine is set up, we can place various sound objects into the scene by creating
32
\l QSpatialSound objects and specifying a url to a sound file using the \l
33
QSpatialSound::source property.
34
35
\l QAudioListener can be used to define the position and orientation of a person
36
listening to the sound scene. At max one listener per engine can be used. If no listener
37
is specified, the engine assumes that the listener is at the origin of the coordinate system
38
facing into a positive z direction, with positive y pointing upwards.
39
40
In addition to sound sources and a listener, you can define a geometry that influences how the
41
sound is being experienced by the listener through a set of \l QAudioRoom objects. Rooms
42
are rectangular and support a wide variety of materials for each wall giving a different experience
43
with different sound reflections and reverb. Room effects will get applied if the listener is
44
located inside one of the rooms. If he is inside multiple rooms, the room with the smallest
45
geometrical volume will take precedence.
46
47
If you need some stereo overlay that is independent of the position and orientation of
48
the listener (such as background music or a voice-over), you can use
49
\l QAmbientSound to create the sound overlay.
50
51
For a small QWidget based example showcasing one audio source that can be moved around in a room, have
52
a look at the \l {audiopanning}{Spacial Audio Panning Example}.
53
54
\section1 Reference Documentation
55
56
\section2 C++ Classes
57
58
\annotatedlist spatialaudio
59
60
\section2 QML Types
61
62
\annotatedlist quick3d_spatialaudio
63
64
*/
qtmultimedia
src
spatialaudio
doc
src
spatialaudiooverview.qdoc
Generated on
for Qt by
1.14.0