AttenuationModelInverse QML Type
Defines a non-linear attenuation curve for a Sound. More...
Import Statement: | import QtAudioEngine 1.0 |
Since: | Qt 5.0 |
Inherits: |
Properties
Detailed Description
This type is part of the QtAudioEngine 1.0 module.
AttenuationModelInverse must be defined inside AudioEngine.
import QtQuick 2.0 import QtAudioEngine 1.0 Rectangle { color:"white" width: 300 height: 500 AudioEngine { id:audioengine AttenuationModelInverse { name:"linear" start: 20 end: 500 rolloff: 1.5 } AudioSample { name:"explosion" source: "explosion-02.wav" } Sound { name:"explosion" attenuationModel: "linear" PlayVariation { sample:"explosion" } } } }
Attenuation factor is calculated as below:
distance: distance from sound to listener d = min(max(distance, start), end); attenuation = start / (start + (d - start) * rolloff);
Property Documentation
This property holds the end distance. There will be no further attenuation if the distance from sound to listener is larger than this. The default value is 1000.
This property holds the name of AttenuationModelInverse, must be unique among all attenuation models and only defined once.
This property holds the rolloff factor. The bigger the value is, the faster the sound attenuates. The default value is 1.
This property holds the start distance. There will be no attenuation if the distance from sound to listener is within this range. The default value is 1.
© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.