Search Unity

Wrong Sound Playing on iOS

Discussion in 'iOS and tvOS' started by John-B, Mar 27, 2017.

  1. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    I have a projectile object that plays sounds when it collides with another object. It plays different sounds depending on what it collides with. The problem is, it plays the correct sounds in the Editor, but plays the wrong sounds on iOS.

    Specifically, when the object hits the ground, on iOS it plays a sound it's supposed to play when it hits another object. The sound it plays is the clip assigned to that AudioSource in the Inspector. The clip is changed on collision depending on what's hit.

    I've taken everything out of the scene except the projectile and the ground, so it can't be colliding with anything else. I've also confirmed in OnCollisionEnter that the ground is the collider it's hitting. It's playing the correct clip, I've confirmed the name of the clip immediately before Play(). But on iOS, the sound it plays is different from the one it appears to be playing. If I remove the OnCollisionEnter handler, nothing plays, so the incorrect sound isn't being played by another script. I can't think of any other reason why it would appear to be playing one sound, but is actually playing another. Any ideas?
     
    Last edited: Mar 27, 2017
  2. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    I switched to a completely different sound, and it looks like it is in fact playing the sound it should on a collision with the ground. So now my question is, why does it sound so different on the iPad?

    The ground sound is a dull thud, and sounds like that in the Editor. But on iOS it sounds more like a clink sound, very much like the sound it's supposed to make when it hits another object. Which is why I thought it was the wrong sound. It's like the frequency is too high, the low-frequency thud sounds like a high-frequency clink on iOS. Not just a little different, different enough to make me think it was another sound clip.