HWende
HWende

Reputation: 1705

QML Audio crashing application

My QML app worked without problems under Qt 5.1. Now I use Qt 5.2 and creating a QML Audio element like this:

Audio {
    id: myAudio
    source: "qrc:///sounds/MySound.wav"
}

leads to the application crashing before even the main window is shown. I tried loading the audio from a file and from a resource with no difference.

But it gets even worse (stranger, at least):
The element creation works in the main qml file but not in a child item. I can create an Audio element directly in the main qml file but if I put the same line into another qml file which is use by the main qml file it doesn't work.

Has anybody encountered similar problems with Audio in Qt 5.2?

Update

I can however start the application when I switch to debug build in QT Creator. In release configuration it still does not start. I use Win7 x64.

Upvotes: 3

Views: 635

Answers (1)

folibis
folibis

Reputation: 12874

Try to run the application in debug mode and check console output. Try also this:

import QtMultimedia 5.0

SoundEffect {
    id: myAudio
    source: "qrc:///sounds/MySound.wav"
}

Upvotes: 2

Related Questions