Results 1 to 3 of 3

Thread: QtMultimedia error Sound Effect

  1. #1
    Join Date
    Feb 2017
    Posts
    9
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Thumbs up QtMultimedia error Sound Effect

    Well, my problem is the sound that did not come out because inside the call of the object "Qt.createQmlObject ()" I can not use the QtMultimedia 5.0 module with a "muted:" property that receives the value of!! Qt.application.active ; " I get an error message

    file:///C:/Users/joaovictor/Desktop/demarsia/conteudo/EfeitoSonoro.qml:7: Error: Qt.createQmlObject(): failed to create object:
    file:///C:/Users/joaovictor/Desktop/demarsia/conteudo/inline:1:143: Cannot assign to non-existent property "muted"

    (the module .qml)
    O módulo EfeitoSonoro.qml:qterr.jpg

    Qt Code:
    1. import QtQuick 2.0
    2. import QtMultimedia 5.0
    3. //Proxies a SoundEffect if QtMultimedia is installed
    4. Item {
    5. id: container
    6.  
    7. property QtObject effect: Qt.createQmlObject('import QtMultimedia 5.0; EfeitoSonoro{ source: " ' + container.source + ' "; muted: !Qt.application.active } ', container);
    8. property url source: ""
    9. onSourceChanged: if (effect != null) effect.source = source;
    10. function play() {
    11. if (effect != null)
    12. effect.play();
    13. }
    14. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 7th February 2017 at 08:22. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QtMultimedia error Sound Effect

    Your EfeitoSonoro element doesn't seem to have a "muted" property.

    Also, are you sure you want to create an object of its own type inside the object?

    Cheers,
    _

  3. #3
    Join Date
    Feb 2017
    Posts
    9
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows Android

    Cool Re: QtMultimedia error Sound Effect

    Thanks !! I'm a newbie but now I understand that the call of a object is other QML object and not my created qml. now works perfectly

    the SoundEffect{} is the correct call very thanks dude!

Similar Threads

  1. QtMultimedia not included
    By dott_infernus in forum Installation and Deployment
    Replies: 1
    Last Post: 4th April 2013, 17:05
  2. [QT5] QtMultimedia | i can`t get metadata
    By petrusPL in forum Newbie
    Replies: 0
    Last Post: 27th February 2013, 15:16
  3. QtMultimedia module in QT 4.5
    By vijay_kansal in forum Qt Programming
    Replies: 8
    Last Post: 12th December 2010, 12:52
  4. Phonon Cannot Play Sound (without Error)
    By padawan in forum Qt Programming
    Replies: 5
    Last Post: 16th September 2009, 16:17
  5. MP3 Sound / OGG Sound Play on GUI
    By patrik08 in forum Newbie
    Replies: 3
    Last Post: 1st September 2006, 20:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.