Quiet audio on iOS

Hey there,

I managed to bypass the ear speaker bug by using Photon mic type and adding IOSAudioForceToSpeaker.

Now I'm onto quiet audio on my iPhone7 using Photon Voice 1 and Photon Mic type. It does use the right speaker.

When I add the following to PhotonVoiceNetwork/OnAudioFrame
for(int i =0; i < frame.Length; i++) { frame[i] *= (5); }
the audio does get slightly louder BUT it gets more polluted and not as clear the more I increase this coefficient. So this is not a solution for an iPhone for me - the quality of the audio is not acceptable if I do the above with any coefficient.

When I add Photon Voice to my scene - the rest of my audio (not the voice parts) also get quieter so it affects everything in my project.

Please, could you provide a solution for a loud and clear audio on iOS.

Thank you!

zelena

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @zelena,

    Thank you for choosing Photon!

    is it possible for you to update to PUN2 and Photon Voice 2?
    at least give it a try in a fresh clean project with the demo scenes provided and see if it fixes your iOS issue.
  • Hey @JohnTube,

    Thank you for the fast response!

    Here's what I did:
    1) Created a clean new project with Photon PUN 2 and Photon Voice 2.
    2) I compiled DemoVoicePun-Scene.
    3) The first attempt was doing the ear speaker thing again so I had to switch to Mic Type Photon and add IOSAudioForceToSpeaker (like I did in Photon 1).
    4) Now the sound started coming out of the normal speaker but the sound is really quiet just like in Photon 1.

    I tried this on several iPhones and they all had the same result.

    Please, could you provide guidance on how to solve this issue?

    Thanks,
    zelena

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @zelena,

    When using Photon MicrophoneType, the IOSAudioForceToSpeaker component must not be used.
    Could you try one more time without it?

    If possible, provide the Unity version and for each iPhone tested and has the issue: model and iOS version.
    Thank you for your help.
  • @JohnTube I have tried this - the audio comes out of the ear speaker in this case. (if I omit adding IOSAudioForceToSpeaker but only use Photon MicrophoneType).

    Unity 2018.1.3f1, iPhone7 (both) and iOS: 12.1, 11.4.1

    Thanks!
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited December 2018
    Hi @zelena,

    just to make sure, did you try it (Photon MicrophoneType without IOSAudioForceToSpeaker) in Photon Voice 2.1.3 or 1.16?
    Please try it in 2.1.3.
    Thank YOU!
  • Hi @JohnTube ,

    I tried Photon Voice 2.1.3 and only Photon Mic Type - the correct speaker is used (so indeed IOSAudioForceToSpeaker isn't needed in Photon2) but the audio is very quiet again. Please, suggest further actions on making the volume higher and for the audio to stay clear.

    PS I have tried the following in the Speaker/frames in Photon2 but again the audio is quiet if I try 5,20, 40, etc. It does get slightly louder with this change but not even close to the normal volume of Facetime, youtube, etc - still very quiet.
    for(int i =0; i < frame.Length; i++) { frame[i] *= (5); }

    Thanks,
    zelena
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @zelena,

    Thank you for your detailed reports and your tests.
    My colleague @vadim will look into it.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited December 2018
    Hi @zelena,

    my colleague @vadim gave us a hint:

    does this issue happen on iOS only?
    does this issue happen on all of our demos?
    did you try it using TestVoice demo in Photon Voice 1?

    I'm asking because this is maybe not a Recorder issue but rather a Speaker one.
    Make sure AudioSource.spatialBlend in the GameObject as the PhotonVoiceSpeaker/Speaker component is not set to 1 but 0.

    You could also log recorder audio input level in Photon Voice 2 using:
    Recorder.LevelMeter.CurrentAvgAmp
    this is to make sure the recorder transmitted audio is not the cause of this.