Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] qt gameenabler audio plugin for qml

    Mobile and Embedded
    1
    2
    1117
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tommyj23 last edited by

      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&#40;QLatin1String("qml/sonidos2/main.qml"&#41;&#41;;
      viewer.showExpanded();
      
      return app->exec&#40;&#41;;
      

      }@

      in main.qml:
      @import QtQuick 1.1
      import GEAudio 1.0

      Rectangle {
      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(&#41;
      
      }
      

      }@

      "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?

      1 Reply Last reply Reply Quote 0
      • T
        tommyj23 last edited by

        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!!!!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post