Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

QAudioRoom Class

Header: #include <QAudioRoom>
CMake: find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)
target_link_libraries(mytarget PRIVATE Qt6::SpatialAudio)
qmake: QT += spatialaudio
Inherits: QObject

Public Types

enum Material { Transparent, AcousticCeilingTiles, BrickBare, BrickPainted, ConcreteBlockCoarse, …, UniformMaterial }
enum Wall { LeftWall, RightWall, Floor, Ceiling, FrontWall, BackWall }

Properties

Public Functions

QAudioRoom(QAudioEngine *engine)
virtual ~QAudioRoom()
QVector3D dimensions() const
QVector3D position() const
float reflectionGain() const
float reverbBrightness() const
float reverbGain() const
float reverbTime() const
QQuaternion rotation() const
void setDimensions(QVector3D dim)
void setPosition(QVector3D pos)
void setReflectionGain(float factor)
void setReverbBrightness(float factor)
void setReverbGain(float factor)
void setReverbTime(float factor)
void setRotation(const QQuaternion &q)
void setWallMaterial(QAudioRoom::Wall wall, QAudioRoom::Material material)
QAudioRoom::Material wallMaterial(QAudioRoom::Wall wall) const

Signals

Detailed Description

Defines a room for the spatial audio engine.

If the listener is inside a room, first order sound reflections and reverb matching the rooms properties will get applied to the sound field.

A room is always square and defined by its center position, its orientation and dimensions. Each of the 6 walls of the room can be made of different materials that will contribute to the computed reflections and reverb that the listener will experience while being inside the room.

If multiple rooms cover the same position, the engine will use the room with the smallest volume.

Member Type Documentation

enum QAudioRoom::Material

Defines different materials that can be applied to the different walls of the room.

Constant Value Description
QAudioRoom::Transparent 0 The side of the room is open and won't contribute to reflections or reverb.
QAudioRoom::AcousticCeilingTiles 1 Acoustic tiles that suppress most reflections and reverb.
QAudioRoom::BrickBare 2 Bare brick wall.
QAudioRoom::BrickPainted 3 Painted brick wall.
QAudioRoom::ConcreteBlockCoarse 4 Raw concrete wall
QAudioRoom::ConcreteBlockPainted 5 Painted concrete wall
QAudioRoom::CurtainHeavy 6 Heavy curtain. Will mostly reflect low frequencies
QAudioRoom::FiberGlassInsulation 7 Fiber glass insulation. Only reflects very low frequencies
QAudioRoom::GlassThin 8 Thin glass wall
QAudioRoom::GlassThick 9 Thick glass wall
QAudioRoom::Grass 10 Grass
QAudioRoom::LinoleumOnConcrete 11 Linoleum floor
QAudioRoom::Marble 12 Marble floor
QAudioRoom::Metal 13 Metal
QAudioRoom::ParquetOnConcrete 14 Parquet wooden floor on concrete
QAudioRoom::PlasterRough 15 Rough plaster
QAudioRoom::PlasterSmooth 16 Smooth plaster
QAudioRoom::PlywoodPanel 17 Plywodden panel
QAudioRoom::PolishedConcreteOrTile 18 Polished concrete or tiles
QAudioRoom::Sheetrock 19 Rock
QAudioRoom::WaterOrIceSurface 20 Water or ice
QAudioRoom::WoodCeiling 21 Wooden ceiling
QAudioRoom::WoodPanel 22 Wooden panel
QAudioRoom::UniformMaterial 23 Artificial material giving uniform reflections on all frequencies

enum QAudioRoom::Wall

An enum defining the 6 walls of the room

Constant Value Description
QAudioRoom::LeftWall 0 Left wall (negative x)
QAudioRoom::RightWall 1 Right wall (positive x)
QAudioRoom::Floor 2 Bottom wall (negative y)
QAudioRoom::Ceiling 3 Top wall (positive y)
QAudioRoom::FrontWall 4 Front wall (negative z)
QAudioRoom::BackWall 5 Back wall (positive z)

Property Documentation

dimensions : QVector3D

Defines the dimensions of the room in 3D space. Units are in centimeters by default.

Access functions:

QVector3D dimensions() const
void setDimensions(QVector3D dim)

Notifier signal:

void dimensionsChanged()

See also position and QAudioEngine::distanceScale.

position : QVector3D

Defines the position of the center of the room in 3D space. Units are in centimeters by default.

Access functions:

QVector3D position() const
void setPosition(QVector3D pos)

Notifier signal:

void positionChanged()

See also dimensions and QAudioEngine::distanceScale.

reflectionGain : float

A gain factor for reflections generated in this room. A value from 0 to 1 will dampen reflections, while a value larger than 1 will apply a gain to reflections, making them louder.

The default is 1, a factor of 0 disables reflections. Negative values are mapped to 0.

Access functions:

float reflectionGain() const
void setReflectionGain(float factor)

Notifier signal:

void reflectionGainChanged()

reverbBrightness : float

A brightness factor to be applied to the generated reverb. A positive value will increase reverb for higher frequencies and dampen lower frequencies, a negative value does the reverse.

The default is 0.

Access functions:

float reverbBrightness() const
void setReverbBrightness(float factor)

Notifier signal:

void reverbBrightnessChanged()

reverbGain : float

A gain factor for reverb generated in this room. A value from 0 to 1 will dampen reverb, while a value larger than 1 will apply a gain to the reverb, making it louder.

The default is 1, a factor of 0 disables reverb. Negative values are mapped to 0.

Access functions:

float reverbGain() const
void setReverbGain(float factor)

Notifier signal:

void reverbGainChanged()

reverbTime : float

A factor to be applies to all reverb timings generated for this room. Larger values will lead to longer reverb timings, making the room sound larger.

The default is 1. Negative values are mapped to 0.

Access functions:

float reverbTime() const
void setReverbTime(float factor)

Notifier signal:

void reverbTimeChanged()

rotation : QQuaternion

Defines the orientation of the room in 3D space.

Access functions:

QQuaternion rotation() const
void setRotation(const QQuaternion &q)

Notifier signal:

void rotationChanged()

Member Function Documentation

QAudioRoom::QAudioRoom(QAudioEngine *engine)

Constructs a QAudioRoom for engine.

[signal] void QAudioRoom::wallsChanged()

Signals when the wall material changes.

[virtual] QAudioRoom::~QAudioRoom()

Destroys the room.

void QAudioRoom::setWallMaterial(QAudioRoom::Wall wall, QAudioRoom::Material material)

Sets wall to material.

Different wall materials have different reflection and reverb properties that influence the sound of the room.

See also wallMaterial(), Material, and QAudioRoom::Wall.

QAudioRoom::Material QAudioRoom::wallMaterial(QAudioRoom::Wall wall) const

returns the material being used for wall.

See also setWallMaterial(), Material, and QAudioRoom::Wall.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded