You check it first. Implementation may vary in different OSes





Sent from Windows Mail





From: Thomas Tanghus
Sent: ‎Friday‎, ‎June‎ ‎12‎, ‎2015 ‎3‎:‎10‎ ‎PM
To: devel@lists.sailfishos.org





On Friday 12 June 2015 02:21:10 coderusin...@gmail.com wrote:
> Please use SoundEffect class for that:

I did that originally, but on request I have added the option to select a 
custom sound file, and I don't wanna limit users to wav files.

Also the SoundEffect docs says:

"If low latency is not important, consider using the MediaPlayer or Audio 
types instead, since they support a wider variety of media formats and are 
less resource intensive."

> > 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
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to