Jump to content

sound does not play in IOS


sanson1
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

@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?

  1. 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)
  2. 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)
  3. Game working with audio in Cordova Android app
  4. Game working with audio in Cordova iOS app
  5. Game working with audio in Cordova Android app with Crosswalk
  6. Game working with audio in Cordova iOS app with "wkwebview" cordova plugin (only works with iOS >= 8) https://github.com/Telerik-Verified-Plugins/WKWebView

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...