[SailfishDevel] Problem with playing sounds in first application

coderusinbox at gmail.com coderusinbox at gmail.com
Fri Jun 12 02:21:10 UTC 2015


Please use SoundEffect class for that: http://doc.qt.io/qt-5/qml-qtmultimedia-soundeffect.html






Sent from Windows Mail





From: Thomas Tanghus
Sent: ‎Thursday‎, ‎June‎ ‎11‎, ‎2015 ‎11‎:‎06‎ ‎PM
To: devel at lists.sailfishos.org





On Tuesday 03 February 2015 23:13:44 Luis Manuel Ramos Da Costa wrote:
>         Audio {
>             id      : whipSound
>             loops   : Audio.Infinite
>             source:"qrc:/sounds/resources/sounds/whipSound.flac"
>         }

That can teach me to read the ml regularly ;)

The loops property isn't documented in the documentation in the SDK, so I made 
an ugly hack to emulate it:

   Audio {
        id: alarm;
        source: Qt.resolvedUrl(selectedSound);

        property bool forceStopped: false;

        function forceStop() {
            forceStopped = true;
            stop();
        }

        onStopped: {
            if(loopSound && !forceStopped) {
                play();
            } else {
                forceStopped = false;
            }
        }
    }


-- 
Med venlig hilsen / Best regards

Thomas Tanghus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150612/83da4364/attachment-0001.html>


More information about the Devel mailing list