AttenuationModelInverseDefines a non-linear attenuation curve for a Sound. More... Inherits Item This type was introduced in Qt 5.0. Detailed DescriptionThis 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); |