IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QAudioRoom Class

Qt Spatial Audio Documentation.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QAudioRoom Class

  • Header: QAudioRoom

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS SpatialAudio)

    target_link_libraries(mytarget PRIVATE Qt6::SpatialAudio)

  • qmake: QT += spatialaudio

  • Inherits: QObject

  • Group: QAudioRoom is part of spatialaudio, multimedia_audio

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:

  • dimensions() const

  • void setDimensions( dim)

Notifier signal:

  • void dimensionsChanged()

See Also

position : QVector3D

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

Access functions:

  • position() const

  • void setPosition( pos)

Notifier signal:

  • void positionChanged()

See Also

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:

  • rotation() const

  • void setRotation(const &q)

Notifier signal:

  • void rotationChanged()

Member Function Documentation

 

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

Constructs a QAudioRoom for engine.

[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

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

returns the material being used for wall.

See Also

void QAudioRoom::wallsChanged()

Signals when the wall material changes.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+