Sound in phonegap export

0 favourites
  • 15 posts
From the Asset Store
Grenade Sound Library contains: 135 sounds 50 grenade sounds and 85 surface sounds
  • How do I make sound to work in phonegap. I read somewhere that since some version of C2 audio object uses phonegap's audio for playback, but I can't get any sound to play after export. Is there something extra I must do? Thanks in advance.

  • Its a known issue getting audio to work with PhoneGap.

    In the latest built (r77) there is a appMobi export option, If audio is going to work then its most likely with AppMobi.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • and then there's this:

    stefankendall.com/2011/12/29/using-appmobi-stop-immediately

    also I remember Ashley's struggles with them

    and second also, major company like Adobe uses phonegap

    so in conclusion, I'd prefer phonegap export to be the final and working over appmobi as I like to listen to people smarter than me :)

  • and then there's this:

    http://www.stefankendall.com/2011/12/29/using-appmobi-stop-immediately/

    also I remember Ashley's struggles with them

    and second also, major company like Adobe uses phonegap

    so in conclusion, I'd prefer phonegap export to be the final and working over appmobi as I like to listen to people smarter than me :)

    ----------------------------------------------

    I think Adobe actually own Phonegap.

  • I think Adobe actually own Phonegap.

    another reason to concentrate on it instead of appmobi :)

    and true, on appmobi I got sound to work, but still would prefer phonegap.

  • I would also prefer PhoneGap, It's easier to work with. But if you want audio in your game your going to have to use AppMobi. the audio issue is nothing to do with the developers of Construct2, its HTML5 in general, HTML5 + audio is just a bad combination right now. HTML5 is a relatively new technology. You might just have to wait <img src="smileys/smiley6.gif" border="0" align="middle">.

    There is a audio fix found here: http://www.scirra.com/forum/solution-nolag-audio-sfx-on-ios_topic45993_post288090.html.

    I have not actually tested this with a build on phonegap, but it might work. I tested it as a web app and it worked.

    I guess you could use the custom plugin: http://www.scirra.com/forum/plugin-jessejohs-html-elements-pack_topic47084_post294874.html <-- The HTML IFrame one, and call your webapp into a C2 project. Audio might work then..

  • and then there's this:

    http://www.stefankendall.com/2011/12/29/using-appmobi-stop-immediately/

    But that can go both ways ranma.

    Right now phongap has no sound. It is free but adobe is planning on announcing fees as soon as they finish developing Adobe Edge or maybe even sooner. Sure Adobe makes some excellent products but they all come at a very bloated price. Personally I wouldn't use Adobe products if the company I work for wouldn't buy them for me. The truth is there just not worth it. Anything you can do with Adobe products you can do with open source products.

    While appmobi use to have a fee but is now open source, and it has sound. appMobi makes all there money from there hosting service. From what I have been reading they haven't given up on us they are still trying to make Construct 2, and appMobi fully compatible.

    It is these reasons why I would choose appMobi over phonegap.

  • phonegap HAS an audio engine ( docs.phonegap.com/en/1.3.0/phonegap_media_media.md.html )

    which WORKS when called via javascript outside of C2 canvas (modifying the html C2 produces) so I believe it is C2's problem unfortunately :(

    edit: just exported by appmobi, the sound is there, it plays well, also multiple sounds work, but one particular (music that plays in background) doesn't. for now appmobi wins over phonegap :)

  • Have you tried modifying the HTML file C2 exports with the Audio Engine?

  • of course, that's why I said that it works, but if this was the way I wanted to work I wouldn't buy C2 now would I? :) I really hope this can be sorted out and working in a near future as a game without sound is no game. also I believe in scirra guys, I've been here since some really early versions of construct (classic) and seen things they can do, so no reason to stop doing them now, right? :)

    also I quite don't understand why this is not a first priority issue for now :) lack of audio on a mobile game is a HUGE problem. I understand that phonegap support is experimental, but if you can make audio work there with a little bit of hack, why it cannot be implemented into the C2. also I think, if phonegap support would be done in a way that more and more phonegap's features would be implemented, C2 would become a number one mobile game creation tool.

  • Phonegap has native audio plugin for iOS & Android if you need them (you need to add them in the directory, though).

    By the way, PhoneGap is free also, even if Adobe bought PhoneGap, there's still open licences that it needs to respect.

    If you want audio with PhoneGap, edit the index.html, and add a <script> which preloads all audio. You can then call the script from inside C2 with the CallJS plugin. Problem solved ;)

  • Pode, What do i have to call with the CallJS plugin? I looked at there API docs, There was too much stuff for me to figure out what i need. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • you need to make calljs load external js file which contains all your media:

    var sound1 = new Media(src);

    var sound2 = new Media(src);

    ... so on.

    and whenever you need to play sound, call javascript:

    sound1.play();

    this has some problems though, tested in on start of first layout, and for some reason calling just sound1.play() didn't work, but calling alert('play sound');sound1.play() worked.

    also this should really be implemented somehow automatically by construct export hopefully in some of the next releases right?

  • We use PhoneGap's Media API to play audio when you export to PhoneGap, but it appears to simply not work. I have no idea why not. I'll have a look in to fixing it for the next build but I was disappointed with the results and heard it had other problems anyway from other PhoneGap developers.

    PhoneGap's priorities currently seem to be around apps and not games so I'm not sure if they're going to fix game-related issues any time soon. Some PhoneGap plugins exist that can help, but PhoneGap Build doesn't support plugins yet. Without PhoneGap Build you have to download hundreds of megabytes of development software and go through a really complicated setup process, so PhoneGap Build really is the only way to go IMO.

    I haven't got a great deal of experience using AppMobi myself, so I can't comment much, but I did seem to get Space Blaster working OK on my iPad via AppMobi so I'm not sure what "no tablet support" really means. IMO if it works use it, and I'd be interested to know how it goes for you.

  • For me actually it works great (was cheering for phonegap but appmobi just seem to work without any issues at all) and you can use appmobi api to do lots of fun things (vibrate for example) that are not iplemented in C2. So for me it's appmobi now.

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