Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [Solved] qt gameenabler audio plugin for qml

[Solved] qt gameenabler audio plugin for qml

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 1.3k Views 1 Watching
  • 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 Offline
    T Offline
    tommyj23
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      tommyj23
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved