AudioEngine

Organize all your 3d audio content in one place. More...

Import Statement: import QtAudioEngine 1.0
Since: Qt 5.0

Detailed Description

AudioEngine is part of the QtAudioEngine 1.0 module.

import QtQuick 2.0
import QtAudioEngine 1.0

Rectangle {
    color:"white"
    width: 300
    height: 500

    AudioEngine {
        id:audioengine

        AudioSample {
            name:"explosion"
            source: "explosion-02.wav"
        }

        Sound {
            name:"explosion"
            PlayVariation {
                sample:"explosion"
            }
        }

        dopplerFactor: 1
        speedOfSound: 343.33 // Approximate speed of sound in air at 20 degrees Celsius

        listener.up:"0,0,1"
        listener.position:"0,0,0"
        listener.velocity:"0,0,0"
        listener.direction:"0,1,0"
    }

    MouseArea {
        anchors.fill: parent
        onPressed: {
            audioengine.sounds["explosion"].play();
        }
    }
}

AudioEngine acts as a central library for configuring all 3d audio content in an app, so you should define only one in your app.

It is mostly used as a container to access other types such as AudioCategory, AudioSample and Sound.

See also AudioCategory, AudioSample, Sound, SoundInstance, AttenuationModelLinear, and AttenuationModelInverse.