Audio works using remote, but not once deployed

I have a project with some background music playing on one AudioSource attached to the camera, and other effects and stuff playing on a different audio source attached to the camera…

All of this works fine and dandy when I preview it in Unity, however once I build the XCode project and deploy to my device, the sound does not work.

I’m trying to play an mp3 for the background music, and the sound effects are all test effects from the LERPZ tutorial, which are all AIFF files.

Is there something in XCode I need to select to make sure my sound assets are imported correctly or something? I can’t figure out what is going on. Again, it works fine in UNITY.

Ideas?
-Cameron

A bit more info as well:

I tried converting the MP3 to an AIFF, and unchecking 3D sound on all of the sound effects and on the background music. Re-built and again, same thing… Works in UNITY but not once the project is built and on my phone. Volume buttons on the phone while in the game have no effect, but they do increase the ringer volume when I’m outside the application. It’s an older 3G phone, not a 3GS or 4G.

I also tried checking DECOMPRESS ON LOAD on all of the audio files, still no effect.

Help?
-Cameron

Hah, yet more info:

The sound comes through just fine when I plug in headphones to the device, and then the volume up/down buttons increase the headphone volume…

So, why wouldn’t my audio come out of the speakers on the phone?

I know it’s obvious, but just to check… have you tried playing other apps or music with the headphones unplugged to check the speaker is actually working? If you can rule out a speaker malfunction then please can you file a bug report for this (menu: Help > Report A Problem).

Yes, I went into the iPod app and played some music and made sure the volume was turned up on the 3G. It’s weird, it only happens on that device. I’ll file a bug report.

Thanks!

Also, the sound works fine on 3GS models and 4G models according to my testers…

Hi.
Any success with this? I have a similar thing where audio in my game is fine on my iPad and iPhones, but on a client’s iPad2, there’s no audio at all in my game while other apps have no problem with audio. I suspected it was to do with the mute switch etc (I’ve reproduced that problem on the iPad by changing settings from switch mute to switch rotate lock while physically muted), but they say they’ve checked those settings and the switch.
I haven’t had a chance to test it on a different iPad 2 or examine theirs yet.

I’m pretty sure I’ve figured it out after scouring the web and intentionally causing the problem on my iPad 1.

After a lot of research and trying various software tweaks, it appears the problem is indeed to do with the iOS audio profiles and the use of the mute switch being in the mute position when you change the function of the switch.

When the sound is not present as you’d expect, do this:

  1. Double click the home button to bring up the task list.
  2. Swipe to the right to reveal the iPad controls from the left.
  3. At the far left you will see a speaker mute icon. Tap it to unmute the speakers,

Here’s a link to other people’s experiences with this: