[QUESTION] Audio in PhoneGap & AppMobi

0 favourites
  • 5 posts
From the Asset Store
Logo Quiz with 150 prepared logos and answers, automatic question and answer mixing
  • Hello,

    I've create a simple game where there are 4 sounds:

    • background music (C2 music folder)
    • player jump effect (C2 sound folder)
    • shooting effect (idem)
    • explosion effect (idem)

    I've exported it for Android (v.2.3) in 2 version, one with PhoneGap and one with AppMobi, and played on SmartPad 810C res.800x480.

    The game runs ok, physics a little slow, but acceptable.

    I've noticed that the audio:

    • in PhoneGap is ok, all sounds are executed, but the music doesn't go in loop (in C2 I don't see an event like "sound is playing" that could help me to force looping);
    • in AppMobi sounds start only as soon as I do something (for example, I move the player) and the music stops after some seconds.

    Some opinions?

    Thanx,

    Steven

  • The difference between Music and Sound folders aren't the looping or not looping once started, but preload or not.

    All files inside Music will be avaialable within stream (so it won't delay game start), while all files inside Sound will be available right when game starts, because it's downloaded with contents. (at least for me works like this)

    So, to loop, once you Start/Play sound, just choose Looping -> looping on the popup, or, make a condition to set the tag sound to loop.

  • Cassiano, thanx for the replay, but sorry, what you say isn't the question I've proposed.

    I know how the folder works and how to activate the looping, infact I set properly the loop for the music, loaded in Music folder because I want that it's streamed and the effect in Sound folder for immediate availability.

    The game I created works perfectly in the browser: all sounds play, music is correctly in loop, all goes ok.

    The problem is only on Android Tablet, when I convert the game in an Android App with PhoneGap and with AppMobi, as I've explained...

    Steven

  • Oh i see...

    And about forcing the loop, did you tried something like

    Every tick

    • set <tag> to looping

    ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think either PhoneGap or appMobi's audio engines support looping.

    PhoneGap supports the 'On ended' trigger, so you can do 'On music ended -> play music'. I haven't managed to get appMobi to support that one yet though, so for appMobi you'll just have to do something like "Every 30 seconds -> play music" (and work out how long the music track actually is).

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)