Search Unity

Audio iOS speaker volume is low

Discussion in 'Audio & Video' started by mfgage, Nov 21, 2017.

  1. mfgage

    mfgage

    Joined:
    Jun 4, 2013
    Posts:
    24
    iOS version's audio is great with headphones, but the speaker volume is cut in half once the app starts! (PS. I have noticed that audio from the iPod is lower when the app is running as well).

    Can any one help?
     
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    this is most likely caused by selected 'Prepare iOS for recording' setting in player settings;
    as per documentation: https://docs.unity3d.com/Manual/class-PlayerSettingsiOS.html
    'This makes recording latency lower, though on iPhones it re-routes audio output via earphones only.'

    turn it off if you don't need to record
    if you do, and also need normal playback, you need to set audio route manually via audiosession, similarly as e.g. here: https://github.com/cbaltzer/UnitySpeakerFix
    my plugin ( link in the signature ) does this automatically
     
    Last edited: Nov 22, 2017
    BjoUnity3d, Starbox and mfgage like this.
  3. mfgage

    mfgage

    Joined:
    Jun 4, 2013
    Posts:
    24
    Thanks so much r618! That was the trick. Have no idea how that got toggled on.. whoa
     
    r618 likes this.
  4. mfgage

    mfgage

    Joined:
    Jun 4, 2013
    Posts:
    24
    One more issue r618 if you could please help me (or someone else that knows this stuff)..

    When I unchecked 'Prepare iOS for recording' my app no longer runs in the background (after screen dims or press lock or home). I need this feature.

    Thanks
     
  5. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,305
    does unity actually run in background when 'Prepare iOS for recording' is enabled ? that's just a unintended side effect then and was just a coincidence that iOS didn't suspend it (*) immediately (because audio session was running) - but it could have done that any time it found reasonable :)
    unity application is not suitable to take full advantage of background modes on iOS - described e.g. here: https://developer.apple.com/library.../BackgroundExecution/BackgroundExecution.html -

    this is previous discussion thread: https://forum.unity.com/threads/continue-running-app-in-background-for-audio-generation-ios.110512/

    (*) or took an action corresponding to 'behavior in background' player settings -
    which you can use - to a degree - by implementing custom behavior in background;
    and I don't know how exactly newer version of unity might, or might not enable running the whole application ( i.e. user scripts in unity ) in background