AudioListenerThe AudioListener type allows you to control global listener parameters. More... Inherits Item This type was introduced in Qt 5.0. Properties
Detailed DescriptionThis type is part of the QtAudioEngine 1.0 module. AudioListener will have only one global instance and you can either access it through the listener property of AudioEngine: import QtQuick 2.0 import QtAudioEngine 1.0 Rectangle { color:"white" width: 300 height: 500 AudioEngine { id:audioengine listener.up:"0,0,1" listener.velocity:"0,0,0" listener.direction:"0,1,0" listener.position:Qt.vector3d(observer.x, observer.y, 0); } Item { id: observer x: 10 + observer.percent * 100 y: 20 + observer.percent * 80 property real percent: 0 SequentialAnimation on percent { loops: Animation.Infinite running: true NumberAnimation { duration: 8000 from: 0 to: 1 } } } } or alternatively, by defining an AudioListener outside AudioEngine: import QtQuick 2.0 import QtAudioEngine 1.0 Rectangle { color:"white" width: 300 height: 500 AudioEngine { id:audioengine listener.up:"0,0,1" listener.velocity:"0,0,0" listener.direction:"0,1,0" } AudioListener { engine:audioengine position: Qt.vector3d(observer.x, observer.y, 0); } Item { id: observer x: 10 + observer.percent * 100 y: 20 + observer.percent * 80 property real percent: 0 SequentialAnimation on percent { loops: Animation.Infinite running: true NumberAnimation { duration: 8000 from: 0 to: 1 } } } } This separate AudioListener definition is allowed to make qml bindings easier in some case. Property DocumentationThis property holds the normalized 3d direction vector of the listener. This property holds the reference to AudioEngine, must be set only once. This property will modulate all audio output from audio engine instances. This property holds the 3d position of the listener. This property holds the normalized 3d up vector of the listener. This property holds the 3d velocity vector of the listener. |