[SailfishDevel] Problem with playing sounds in first application

Luis Manuel Ramos Da Costa aliasbody at gmail.com
Wed Feb 4 14:16:15 UTC 2015


Thank you for your help.

Which is weird is that I can play the music, but after it ends I can't play
it again.

The status begins at 3 then 6 when play, and 2 when ending playing. When I
press the status stays at 2.

I'll try to use SoundEffectin order to see if it solves anything, anyway
making the song 4 or more seconds doesn't solve the problem, but thank you
for the proposition :)

Best Regards,
Luis Da Costa

2015-02-04 13:07 GMT+00:00 Juho Hämäläinen <juho.hamalainen at tieto.com>:

> On 04.02.2015 01:13, Luis Manuel Ramos Da Costa wrote:
>
>> Hello Everyone,
>>
>> I've started developing for Jolla today, I am quite familiarez with the
>> Qt/C++ language but not enough with the QML part.
>>
>>          Audio {
>>              id      : whipSound
>>              loops   : Audio.Infinite
>>              source:"qrc:/sounds/resources/sounds/whipSound.flac"
>>          }
>>      }
>> }
>>
>
> For this particular case if you are going to play your sample only once,
> remove the "loops" part, with loops Audio.Infinite the sample will loop
> indefinitely until the playback is stopped.
>
> As to just playing short samples, SoundEffect is better suited to the
> task. SoundEffect unfortunately doesn't accept flac files as source, you'll
> need to use wav instead, but as the samples won't be long anyway it's not
> that bad. Using SoundEffect the above code part would be something like
>
>     SoundEffect {
>         id      : whipSound
>         source  : "qrc:/sounds/resources/sounds/whipSound.wav"
>     }
>
>  And I have a problem with this. The song plays one time by taping on the
>> picture (the song is a .flac file with 1second long of audio), and after
>> that if I press the picture again it simply doesn't play.
>>
>
> This sounds like a bug (which I couldn't reproduce when quickly testing
> (as you described it). I only saw that trying to play 1 second long flac
> with Audio always failed, raising the length to 4s and the sample played
> fine. Something is wrong anyway so I'll investigate more.
>
>
> --
> juho
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.
> sailfishos.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20150204/b6f7fe8d/attachment.html>


More information about the Devel mailing list