Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. SoundEffect not playing sound.I put "fixed.wav" file on the same folder.
Forum Updated to NodeBB v4.3 + New Features

SoundEffect not playing sound.I put "fixed.wav" file on the same folder.

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.7k 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.
  • D Offline
    D Offline
    DanSiddiqui
    wrote on last edited by
    #1

    SoundEffect not playing sound.I put fixed.wav file on the same folder

    @
    Below is my code 'qml file'

    import QtQuick 1.0

    import Qt 4.7
    import QtMultimediaKit 1.1

    Rectangle {
    width: 360
    height: 640

    Text {
        id:textlabel
        x: 81
        y: 131
         text: "Click Me!";
         font.pointSize: 24;
         width: 150; height: 50;
    
         SoundEffect {
             id: playsound
             source: "fixed.wav"
    
         }
         MouseArea {
             id: playArea
             x: -23
             y: 1
             anchors.rightMargin: 23
             anchors.bottomMargin: -1
             anchors.leftMargin: -23
             anchors.topMargin: 1
             anchors.fill: parent
             onPressed: { playsound.play() }
         }
     }
    

    }

    @

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DanSiddiqui
      wrote on last edited by
      #2

      When i put
      source: "file:///D:/QtSDK/Examples/4.7/declarative/demos/samegame/qml/fixed.wav"
      its working but when i put,
      source: "fixed.wav"
      it is not working.

      please reply.

      @SoundEffect {
      id: playsound
      source: "fixed.wav"
      //source: "file:///D:/QtSDK/Examples/4.7/declarative/demos/samegame/qml/fixed.wav"

                }@
      
      1 Reply Last reply
      0
      • J Offline
        J Offline
        jr_jags
        wrote on last edited by
        #3

        you should import the qtmultimediakit

        @
        import QtQuick 1.0
        import QtMultimediaKit 1.1
        @

        and edit your .pro file

        CONFIG += mobility
        MOBILITY += multimedia

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DanSiddiqui
          wrote on last edited by
          #4

          I have already add these lines on my project file,the main concern is about the source of the soundeffect. as i mentioned in my last reply.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jkosonen
            wrote on last edited by
            #5

            Is your QML file in the resource, if, then it tries to find your audio from the resource too.

            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