Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 1 Support › First sound after loading gets “eaten”

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3990

    Heini

    Hi Chris,

    its me again…
    I would like to play a welcome-sound after loading the mainscreen of the game. Therefore I call the Component.onCompleted-function from where I call the play function of the welcomesound object. But it seams that the first sound after loading the game always gets “eaten” and does not play (seams like sound is not enabled yet at this point…). When i push a menubutton which should also play a sound i have the same problem: if its the first time any sounds gets played after gamestart, the sound does not play. All following sounds play well.

    Greetings

    Heini

    #4041

    Christian
    Felgo Team

    Hi Heini,
    do you use the BackgroundMusic or the Sound element? The BackgroundMusic would have an autoPlay property, which is set to true by default so it is loaded at app startup.

    Could you provide the relevant source code how you are playing the sound please?

    Cheers,
    Chris

    #4042

    Heini

    Hi Chris,

    I used the Sound element. Using BackgroundMusic the playback starts just before the scene is painted and this is not what i wanna do.
    Now i made a workaround by using the Sound element with a timer but i´m not sure if the interval of 1000 ms is matching on all systems.

    Bye

    Heini

    #4043

    Christian
    Felgo Team

    It depends where you put your BackgroundMusic item – it will start playing in onCompleted by default when autoPlay is set to true. You could also set autoPlay to false and then trigger the play with the Timer approach you already mentioned.

    If you put the sound loading to a Timer where the Scene is drawn (trigger the onCompleted for that), you should be fine on all system. In general, it is a good idea to keep the inital loading time low. You can accomplish that with the Loader item, where the scenes are not loaded at app startup, but only when you set the source property. It is done this way in the updated versions of Squaby and Chicken Outbreak which will be available this week as part of the major update.

    Cheers,
    Chris

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded