IOS sound problems since iOS 9.2

0 favourites
From the Asset Store
Best soundtracks for any game. High quality and engaging assets.
  • I tested an iPad Air 2. Does anyone else have one to test and does it definitely not reproduce on that? iOS devices tend to be pretty consistent so deviations like this tend to be unusual.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tested an iPad Air 2. Does anyone else have one to test and does it definitely not reproduce on that? iOS devices tend to be pretty consistent so deviations like this tend to be unusual.

    Ashley Not tested it personally but here's what one of my testers had to say: "Get the buzzing sound on iPhone 5 you mentioned and no music. 9.01. iPad air 2 is fine and noticed it's running 8.0.2"

    The iPad air 2 mentioned is only running iOS 8.0.2 which doesn't make it an ideal test. I've also tested it on an old iPad mini with iOS 9.2 and the bug isn't happening. It really does look like an iPhone only issue.

    Are you able to get hold of an iPhone to test this on?

  • It's a bit weird with the recent iOS, if you test your game and it plays music, you can see it in the AirDrop menu, the exactly folder & music file name is displayed.

    I think Apple is doing some funky stuff, if it detects Safari playing audio it somehow separates it to it's main audio player for other purposes.

    The thing is our wrappers are Safari based and iOS is treating it like a website and not a standalone app.

  • I have been getting exactly the same problem since iOS 8 on my iPhone and both test iPads (3 and Air 2). I'm trying to figure out a reliable way of reproducing it but it is quite random. If I spend a full day working on an app I will probably have to restart my iPad once or twice to fix it.

    Ashley I found a discussion on stack overflow which might be of help. The last post seems to be a fix for the problem, definitely looks like it is related to a sample rate mis-match.

    stackoverflow.com /questions/17892345/ webkit-audio-distorts-on-ios-6-iphone-5-first-time-after-power-cycling /34501159#34501159

    This is also interesting stackoverflow.com /questions/29901577 /distorted-audio-in-ios-7-1- with-webaudio-api

    Had to put spaces in the links because it wouldn't let me post them otherwise.

  • shortwave - those are interesting links - it sounds like it's an iOS bug that has been around for a while, and it definitely sounds like it's something to do with iOS changing the sampling rate as mentioned earlier in the thread:

    [quote:1w4jr61m]I believe the issue is caused due to resetting the audioContext.sampleRate prop, which seem to happen after the browser/OS plays something recorded in a different sampling rate.

    [quote:1w4jr61m]I noticed that if you play a video using a <video> tag, it sets the context.sampleRate value to whatever the video's audio was encoded at. It seems as if iOS Safari has one global sampleRate that it uses for everything...

    This global sample rate appears to persist across page loads and is shared between tabs and browser instances. So, playing a youtube video in another tab could break all your decoded audio.

    So under some circumstances iOS ends up playing audio buffers at the wrong sample rate, which probably corrupts the audio and sounds distorted.

    I think this confirms it's an iOS bug and not something wrong with our own code, so the best we could do from here is figure out a reliable way to reproduce it and forward it to Apple. I think the repro will look something like:

    1. Open a C2 project in Safari which plays some audio at 44.1KHz

    2. Close Safari

    3. Open something else that plays audio at a different sample rate, e.g. 48KHz

    4. Close that and go back to Safari

    5. See if the audio is distorted

    However as per usual in bug reports, we need absolute specifics for every step. So I think it's just a matter of finding something reliable for step 3 (e.g. a youtube video or something public and reliable like that).

    I've looked at some of the workarounds and they look very difficult - they say things like "just recreate the AudioContext", but in our engine that would mean tearing down and rebuilding the entire audio routing graph, and possibly re-decoding audio buffers. That's complicated and we have no code to cover that right now since normally there's no need to ever do that, and implementing it is enough new code that it is likely to cause as many problems as it solves (as already happened recently with an Android audio bug, and that was much simpler!) Other workarounds like "just play an audio buffer at this frequency" don't make sense, because it's already doing that when you play a new sound when coming back, but it still sounds distorted.

    The good news is I think this should have limited impact - it seems unlikely it will affect everyone, it's just certain combinations of playing something else in between Safari.

  • Ashley, i created this thread. Have you tried my original repro (post #1)?

    I can repro this consistently, meaning if i try it 100 times, it repros 100 times on my iphone 6.

    From your posting, it appears that you do not own iphone, only ipad.

    As you stated, the issue probably is in how iOS broke contract, but it is surprising that Construct team doesn't own a single iphone and therefore can't verify the simple repro steps.

    The cheapest paid license cost $100 and people generally look for better support (at least try the repro on the device where people say the issue is occuring) when they pay such money for a software.

    My repro does not involve playing sound in another app as stated in my repro steps (page 1)

    For now, i had to turn off sound entirely on my iOS game and it is really lame.

  • well said kimtaein1

    Scirra Ltd trying to be a professional company, but all this looks very amateur. They do not have an iPhone....well.. seriously?

    I don't understand why they ignoring us. Us, who really are able to pay for the Scirra software.

    For example, I might pay a monthly fee if all work correctly and I can producing a quality games. Scirra Ltd activity does not seem very professional. This is not a business.

  • Hi,

    any solution about this problem ?

    because converting sound to lower khz giving bad quality sound

  • I can't release my game because of this. This is disgusting....

  • The good news is I think this should have limited impact - it seems unlikely it will affect everyone, it's just certain combinations of playing something else in between Safari.

    Yep, because that iPhone thing never took off...

    What happens when apple call this a feature?

  • Of course we have iPhones, when people report iOS bugs the first device I reach for is the iPad Air 2, since I was not clear this is a device-specific issue, which also tend to be rare since iOS is more or less identical across devices. I will keep investigating, but as I already mentioned, it seems likely the problem is with iOS itself so the problem is not to do with our code and we can't directly fix it ourselves, it's a problem with Apple's software.

  • Ashley - I'm not sure if you saw this on the other thread related to the iOS audio issue but here it is again. I think its worth a look and test on an iPhone in Safari.

    If you open this link http://www.williammalone.com/posts/ios- ... ile-issue/ in an iPhone (I'm on a iPhone 6 running iOS 9.2)

    First "touchstart" audio is distorted but the other two methods are fine. Try that link out on an iPhone in Safari to reproduce the grainy audio.

    Looks like if you use "touchend" the audio plays fine. Would it be possible to add this as an action in Construct like we have touchstart on an object?

    kimtaein1 & It would seem everyone developing for iPhone / iOS 9 using Construct 2 / Cordova is facing this problem - this isn't the first thread I've seen here. I do think its strange I can't find this topic anywhere else on the web that's current except for Scirra forums. I'm glad this topic is finally getting some Construct 2 traction.

  • Hey mars1985 , thanks for the heads up!

    I'm also a frustrated iOS game dev. I've created an iPhone game using Construct 2 and I'm just waiting for this bug to be fixed (by Scirra or Apple).

    Since iOS 9.2 the audio is distorted. I've tried different export and build combinations to find a way to fix it with no success.

    Right now I'm using a Cordova Export with a Phone Gap build. The audio is fine on Android but distorted on iPhone.

    I've also tried to replace the sound events in my game's javascript file with this "touchend", but I found it impossible to understand that file.

    I also would like to ask Ashley to try to reproduce this error on an iPhone please, not on an iPad. The majority of iOS players are iPhone users. The iPhone also sells more than iPads. Please do it.

    A sneak peek of my game, just waiting for this fix to be launched:

  • Looks like if you use "touchend" the audio plays fine. Would it be possible to add this as an action in Construct like we have touchstart on an object?

    We already made this change shortly after iOS 9 came out, so all current versions of C2 are already doing that.

  • > Looks like if you use "touchend" the audio plays fine. Would it be possible to add this as an action in Construct like we have touchstart on an object?

    >

    We already made this change shortly after iOS 9 came out, so all current versions of C2 are already doing that.

    Ashley there isn't a on object "touchend" like there is for on object "touchstart"? Am I missing something?

    The current verision of Construct 2 only has "On any touch end" rather than "On object touchend". There isn't a way to pick an "object" with touchend currently.

    See image: http://picpaste.com/touch-Qnshj4nS.PNG

    On any touch end needs to be used with an object to be useful.

    Did you review the blog post I submitted using an iPhone with Safari to see how "touchstart" causes audio distortion where as "touchend" resolves this problem? http://www.williammalone.com/posts/ios- ... ile-issue/

    majesticAsFk do you have any thoughts on this - I know you are switching to Unity but does this sound like a plausible solution?

    rafaelfe thanks for the feedback - your game looks really great but kind of useless if you can't resolve the audio / sound problems! Have you considered Unity? I am not familiar with it but sounds like some Construct 2 iOS developers are moving to it.

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