Cannot hear voice in the editor neither see created speaker i the hierarchy. However works on device

Currently added photon voice V2 chat along with UNET. Using also OVR plugin because using "Oculus GO" . My setup is that i have Voice connection, Recorder and ConnectAndJoin on a separate Game Object. Voice seems to connect just fine on our Oculus GO device. However when hosting from both editor and even standalone build voice seems not to work on those.
No errors seem to occur when running the application. I seems that it gives the same voice ID to both clients.
Here are the inspector settings:

https://drive.google.com/file/d/1eohou7RSeq72u1Vtj9s_XSV_tfaoBar1/view?usp=sharing

I am connecting manually on player object Start function therefor AutoConnect and AutoTransmit are disabled. Previously tried them enabled did not work. If you need anything to know other that I've posted. I will provide everything below.

Comments

  • JohnTubeJohnTube mod
    edited January 21
    Hi @Reaper,

    Thank you for choosing Photon!

    However when hosting from both editor and even standalone build voice seems not to work on those.
    I seems that it gives the same voice ID to both clients.
    Could you make sure both Voice clients are connected to the same region (try setting explicit fixed region), have the same AppVersion (if you enable "Use PUN Settings", the value of AppVersion in ConnectAndJoin may be overwritten by that one) and joined to the same room (sometimes if you try random join from two clients at the same time, they end up creating two different rooms because no match was found by both)?
    I am connecting manually on player object Start function
    How?
    Previously tried them enabled did not work.
    What do you mean it didn't work?
    If you need anything to know other that I've posted. I will provide everything below.
    We usually ask for Photon Voice version and Unity version.
    On another note:
    Currently added photon voice V2 chat along with UNET.
    In this case if don't think you need PUN2 or Photon Chat, you could clean those up, read more here.
  • ReaperReaper
    edited January 21
    Hi @JohnTube
    Thanks for quick response
    Could you make sure both Voice clients are connected to the same region (try setting explicit fixed region), have the same AppVersion (if you enable "Use PUN Settings", the value of AppVersion in ConnectAndJoin may be overwritten by that one) and joined to the same room (sometimes if you try random join from two clients at the same time, they end up creating two different rooms because no match was found by both)?

    I am going to try that then come back if it solved the issue. However i forgot to mention that it seems kinda random. Sometimes i hear voice on client only,sometimes i can hear on both and sometimes nether of them works. That is strange because i do not change anything i just relaunch programs
    I am connecting manually on player object Start function
    How?
    Previously tried them enabled did not work.
    What do you mean it didn't work?
    Here the code that does that from a Player GameObject which is spawned by Network Manager
    
    private ConnectAndJoin myVoiceConnector;
    private void Start()
        {
            myVoiceConnector = FindObjectOfType<ConnectAndJoin>();
    
           if(isLocalPlayer)
    
              {
    
               ConnectVoice();
    
               }
        }
    private void ConnectVoice()
        {
    
            myVoiceConnector.ConnectNow();
    
            myVoiceConnector.voiceConnection.PrimaryRecorder.TransmitEnabled = true;
            myVoiceConnector.voiceConnection.PrimaryRecorder.Init(myVoiceConnector.voiceConnection.VoiceClient;
    
        }
    
    We usually ask for Photon Voice version and Unity version.

    Unity v 2018.3.1f1 and Photon v Pun: 2.2 Photon lib: 4.1.2.1

    In this case if don't think you need PUN2 or Photon Chat, you could clean those up, read more here.

    Thanks probably will do that aswell
  • Hi again @JohnTube

    I've tried previous fix and that seem eliminate the case when nether of users gets the sound. But it still doesn't seem to work in the editor.And by "not working " i mean that i don't get to hear the sound and neither i see the speaker prefab appearing on editor side. Is there a reason to that? Can i make it work?
  • JohnTubeJohnTube mod
    edited January 22
    Hi @Reaper,

    And by "not working " i mean that i don't get to hear the sound and neither i see the speaker prefab appearing on editor side. Is there a reason to that?
    Could you make sure both clients are connected to the same server/region, use the same AppVersion and are joined to the same room? try enabling SupportLogger or log those values manually.

    Could you reproduce using DemoVoiceUI?
  • We've found out what the problem was. It was a microphone setting on a Recorder component. It used to be Unity microphone which was looking for Realtek mic on our Oculus Go and obviously fail) We've switched to Photon mic and that did the trick. By the way for the sake of sanity of all the developers that ran into our next problem with voice. App can sometimes not request a microphone permission on its first launch so force request on start if that happens.
  • Thanks for your help @JohnTube
  • You're welcome @Reaper.

    By the way for the sake of sanity of all the developers that ran into our next problem with voice. App can sometimes not request a microphone permission on its first launch so force request on start if that happens.
    Do you have some clear steps to follow that we could add to our "Known Issues" page, Photon Voice section?
  • ReaperReaper
    edited February 7
    @JohnTube Yes of course)

    The problem is that you app for some reason may not request a permission on its first launch.

    Basically what you do is you write a following piece of code either on start of an existing script that is in your scene or create a new one.

    void Start ()
        {
            #if PLATFORM_ANDROID
            if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
            {
                Permission.RequestUserPermission(Permission.Microphone);
            }
            #endif
        }
    That is for android however it is similar for other platforms.
    You can also go further and make an explanation message for user why do you need permissions.
    More detailed explanation about it you can find here


  • Ah I see now, this is a new feature in 2018.3!
    Thanks for the link! we will add it here.
  • Ah I see now, this is a new feature in 2018.3!
    Thanks for the link! we will add it here.

    Glad that this was actually helpful))
Sign In or Register to comment.