sanson1 Posted August 30, 2016 Share Posted August 30, 2016 Hello, I have a problem to play the sound of a game in IOS. I have compiled the game XDK intel, phonegap build and profit not play the sound in IOS, the game uses CreateJS. I hope you can guide this problem, attach the file Thanks! CMain.js Quote Link to comment Share on other sites More sharing options...
alex_h Posted August 30, 2016 Share Posted August 30, 2016 Normally one of two things 1) on iOS sound can only be initialised by a user interaction (ie a touch event). Check that this is correctly configured 2) are you sure your sounds are in an iOS compatible format? .ogg is not supported on iOS for example. Ideally you want to use .m4a for iOS and anywhere else that .ogg is not supported. Quote Link to comment Share on other sites More sharing options...
b10b Posted August 30, 2016 Share Posted August 30, 2016 Assuming this works as it should in iOS mobile safari (i.e. both of @alex_h suggestions are validated) ... For iOS + SoundJS + Cordova / XDK / PhoneGap use the plugin "wkwebview". Not only will this accelerate performance on the latest devices, it will shift file access from file:// protocol to http:// protocol, and allow SoundJS to load the sound via xhr which is needed for the WebAudioPlugin (thereby fixing the no-sound issue). If you don't wish to use that plugin, override SoundJS's default plugin (WebAudioPlugin), and knock it back to the HTMLAudioPlugin (other issues will present instead, but at least you'll have some sound). Quote Link to comment Share on other sites More sharing options...
sanson1 Posted August 31, 2016 Author Share Posted August 31, 2016 Thank you very much for your answers, I searched and asked several places an answer to my problem, but I have not gotten the sound IOS plays, I need to hire someone to fix me this problem, anyone is interested? Quote Link to comment Share on other sites More sharing options...
away168 Posted August 31, 2016 Share Posted August 31, 2016 I usually solve this problem by prompting user to tap the screen after the asset loading is done. Like, after the loading is done, have the game to say "Tap to Continue." That interaction should trigger the sound. Quote Link to comment Share on other sites More sharing options...
alex_h Posted August 31, 2016 Share Posted August 31, 2016 Sounds to me like what b10b said above is the most likely candidate in this case. Quote Link to comment Share on other sites More sharing options...
sanson1 Posted August 31, 2016 Author Share Posted August 31, 2016 I tried it and has not been successful Quote Link to comment Share on other sites More sharing options...
b10b Posted August 31, 2016 Share Posted August 31, 2016 @sanson1 can you break the problem down into milestones and let us know how far you've got ... i.e. where does it work up to? Game working with audio in desktop browsers (one test for ogg, one test for m4a - see this chart for which browsers use ogg vs m4a: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats#Browser_compatibility) Game working with audio in mobile browsers (one test for iOS (Safari) and one test for Android (Chrome). Note SoundJS now includes an auto-handler for the touch iOS initialiser: http://createjs.com/docs/soundjs/files/soundjs_webaudio_WebAudioPlugin.js.html#l355) Game working with audio in Cordova Android app Game working with audio in Cordova iOS app Game working with audio in Cordova Android app with Crosswalk Game working with audio in Cordova iOS app with "wkwebview" cordova plugin (only works with iOS >= 8) https://github.com/Telerik-Verified-Plugins/WKWebView Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.