[Solved] qt gameenabler audio plugin for qml
-
Hello!!
I want to change all the audio of my games to the qt gameenabler audio plugin for qml (it seems much faster than the qt multimedia kit), but I have a problem, the example works ok in the phone and in the simulator, but I create a new project with this thinks:
in the .pro file:
@include(qtgameenabler/qtgameenableraudioplugin.pri)@in main.cpp this:
@#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include "audioplugin.h"using namespace GE;
int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));QmlApplicationViewer viewer; AudioPlugin plugin; plugin.registerTypes("GEAudio"); viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/sonidos2/main.qml")); viewer.showExpanded(); return app->exec();
}@
in main.qml:
@import QtQuick 1.1
import GEAudio 1.0Rectangle {
id:recto
width: 640
height: 360
property int contador:0
Text {
text: recto.contador
anchors.centerIn: parent
}AudioMixer { id: mymixer absoluteVolume: 0.5 enabled: true AudioBuffer { id: sampleA source: "boing.wav" } } MouseArea { anchors.fill: parent onClicked: sampleA.play() }
}@
"https://projects.developer.nokia.com/qtgameenabler/wiki/audio_qml":https://projects.developer.nokia.com/qtgameenabler/wiki/audio_qml
but when I click the button here:
@MouseArea {
anchors.fill: parent
onPressed: sampleA.play();
}@the sound not play,
why?
-
ok, this is now solved here:
"http://www.youtube.com/watch?v=O_-DmTxZUe8":http://www.youtube.com/watch?v=O_-DmTxZUe8
thanks to whiteF for the video!!!!