QAudioListener Class

Defines the position and orientation of the person listening to a sound field defined by QAudioEngine . 更多...

头: #include <QAudioListener>
CMake: find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)
target_link_libraries(mytarget PRIVATE Qt6::SpatialAudio)
qmake: QT += spatialaudio
继承: QObject

公共函数

QAudioListener (QAudioEngine * engine )
virtual ~QAudioListener ()
QAudioEngine * engine () const
QVector3D position () const
QQuaternion rotation () const
void setPosition (QVector3D pos )
void setRotation (const QQuaternion & q )

详细描述

A QAudioEngine can have exactly one listener that defines the position and orientation of the person listening to the sound field.

成员函数文档编制

[explicit] QAudioListener:: QAudioListener ( QAudioEngine * engine )

Creates a listener for the spatial audio engine for engine .

[virtual noexcept] QAudioListener:: ~QAudioListener ()

Destroys the listener.

QAudioEngine *QAudioListener:: engine () const

Returns the engine associated with this listener.

QVector3D QAudioListener:: position () const

Returns the current position of the listener.

另请参阅 setPosition ().

QQuaternion QAudioListener:: rotation () const

Returns the listener's orientation in 3D space.

另请参阅 setRotation ().

void QAudioListener:: setPosition ( QVector3D pos )

Sets the listener's position in 3D space to pos . Units are in centimeters by default.

另请参阅 position () 和 QAudioEngine::distanceScale .

void QAudioListener:: setRotation (const QQuaternion & q )

Sets the listener's orientation in 3D space to q .

另请参阅 rotation ().