facebook

problem with audio playing on Android

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #342533 Reply

    Im writing small game, and in end of game im trying to trigger sound, but nothing happens
    tested on different android phones. trying to do like that:

    function do_gameover_music()
    {
    audio = new Audio();
    audio.src = ‘audio/track.mp3’;
    audio.play();

    $(window).bind(‘pagehide’,audio.pause());
    }

    paths are correct, file in game-www/audio, i also see and check on it when building .apk

    i got codes from this example:
    http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=2123

    but that example also not working on Android. what’s going on, please help asap.

    #342534 Reply

    also i’ve tried it on latest mobione-2.5.0m1-dev, still no luck

    #342535 Reply

    i checked “Audio & Video” and “External Storage” when build .apk and still no luck ..

    #342556 Reply

    Hi nas,

    Please take a look at this recent background audio example that should be helpful for you:
    http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=6013

    #342571 Reply

    thanks brother octavio, i wonder how i could not find that page by myself, sorry.

    it worked, BUT: worked only if mp3 file in root directory like in your brilliant example, i’ve had a problems when file was in “audio/file.mp3”,
    i tried path like “file:///android_asset/www/audio/file.mp3” and it not work. is there any workaround ? or maybe you can point what i’m doing wrong

    #342572 Reply

    support-michael
    Keymaster

    @nas

    We’ll investigate asap and provide feedback on running an mp3 from a subdirectory of the app.

    #342818 Reply

    hi is there any news about audio subdir problem ?

    #343054 Reply

    Hi,

    I have pinged the dev team again for info on this. In the meantime I have tried the example I have shared previously, I’ve put the audio file in a folder called audio. It worked well. I used the latest Mobione 2.5 milestone 2. Also, please be sure that you include your audio file/folder when you are building your app:

    Attachments:
    You must be logged in to view attached files.
Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: problem with audio playing on Android

You must be logged in to post in the forum log in