- This topic has 7 replies, 3 voices, and was last updated 11 years, 2 months ago by support-octavio.
-
AuthorPosts
-
StanislavLikhachevMemberIm 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=2123but that example also not working on Android. what’s going on, please help asap.
StanislavLikhachevMemberalso i’ve tried it on latest mobione-2.5.0m1-dev, still no luck
StanislavLikhachevMemberi checked “Audio & Video” and “External Storage” when build .apk and still no luck ..
support-octavioMemberHi 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
StanislavLikhachevMemberthanks 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
support-michaelKeymasterWe’ll investigate asap and provide feedback on running an mp3 from a subdirectory of the app.
StanislavLikhachevMemberhi is there any news about audio subdir problem ?
support-octavioMemberHi,
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. -
AuthorPosts