Photon voice 2 - Voice chat not working?

Hello,

We have recently started a project with PUN 2 and wanted to add voice chat. We followed the instructions on "Voice for PUN 2" guide and thought it would be rather easy. However, it does not seem to be working at all. None of the players can hear each other and I'm not quite sure why.

The project itself is on VR, HTC Vive, and we have followed the instructions quite strictly. We have also built the DemoVoicePun scene and tried it out, and it does not work there either. We know the microphones are working and so is the sound so we are running out of ideas. Does anyone have any answers to what could have gone wrong?

Comments

  • JohnTube
    JohnTube mod
    edited November 2018
    Hi @NTNU_VR,

    Thank you for choosing Photon and I'm sorry you are running into this issue.

    Do you have any useful Photon Voice logs to share?

    Could you try the following:

    Increase logging level for the Voice components (PhotonVoiceNetwork, Recorder, Speaker) to WARNING and see if you notice any warnings.

    What Unity version are you using?

    You could also try this unreleased version that has few fixes.
    Please be careful when importing: Unity Editor "Native Library Updates".
    I recommend testing in a clean/fresh/new/empty project.
  • It seems we had a rather silly error. When loading the new scene, the recorder would have "Transmit Enabled" as false. We thought having "Transmit Enabled" checked would have it be enabled all the time, but loading the scene seems to bring it back to its' default state.

    Thank you for the help though :)
  • I have now been able to allow some form of voice chat. However, it is quite limited to only one player being able to hear anything. I ran one on the editor and a build on a separate machine. The separate machine created a room and could hear the other player, but the one in the editor could not. When trying to do the reverse, no one could hear anyone.

    We are using Unity 2018.2.13f1, one error we are receiving when the editor creates the room is "ArgumentException: Number of channels in created clip must be greater than 0". Does the GameObject with the PhotonVoiceNetwork component need the "Don't destroy on load" enabled?
  • JohnTube
    JohnTube mod
    edited November 2018
    Did you try using the package from my previous comment or from Voice2.0 from the asset store?

    "ArgumentException: Number of channels in created clip must be greater than 0"
    I think this is due to a Unity known issue and probably a regression in a bug from an old version. Read more about this here. Could you try switching MicrophoneType to Photon as shown here and see if it helps.

    Does the GameObject with the PhotonVoiceNetwork component need the "Don't destroy on load" enabled?
    Yes if you want the voice connection to keep working when you load levels.
  • Yes, we have now imported the package from the previous comment. We can also try your other suggestions.

    On another note, what is the standard way of setting this up? At the moment we have a lobby where you can type a name and a button to join a room (Similar to the guide for setting up PUN 2). We have added the PhotonVoiceNetwork into the room you are loading into, but does it make more sense to have a PhotonVoiceNetwork from the beginning (in the lobby) and just connect when joining the different rooms?
  • Hi @NTNU_VR,

    Photon Voice 2.1 is released already so no need for that custom package anymore.

    If you have PhotonVoiceNetwork with both AutoConnectAndJoin and AutoDisconnectAndLeave enabled then the voice client will follow PUN client:

    1. If PUN joins a room ==> Voice client connects and joins a mirroring room
    2. If PUN leaves a room ==> Voice client will disconnect

    So when PUN is in the lobby, the voice client will not be connected but it is there in case PUN joins a room.
  • matrix211v2
    edited November 2018
    I'm running Photon Voice 2.1 and having the same issue of "ArgumentException: Number of channels in created clip must be greater than 0" when the second person enters the room.

    Also running in a VR environment using the Mic Streaming Service

    Using Unity 2018.2.14f1

    It's a clean project with only PUN2 and Voice 2.1. I can put the project somewhere if it helps.
  • @JohnTube We got it working :), we switched over to Photon MicrophoneType. We also have the Voice gameobject on the lobby instead. The only issue now would be preventing that a new Voice gameobject is made when re-entering the lobby and it seems that other players can only hear sound from one ear. However, we have not yet updated to 2.1 so maybe the update fixes this. We will check it out.
  • @NTNU_VR So all your connections are Mic Streaming Service? What I have done is just try to create two PC versions and have them on different computers and one works the second one throws the ArguementException.
  • @matrix211v1 We tested with a PC that had a build and the other was on a different PC, but the application ran on the editor. We stopped receiving the exception, but not quite sure as to why. This might have something to do with how the components are set up. Have you also tried changing to Photon MicrophoneType?
  • @NTNU_VR Not yet. As you may have run into, using the default scene in VR space, you cannot click buttons or interact with them. Therefore I set them to "Voice Detection" and "Transmit" on by default and save / build the scene. I change the Mic to Microphone Streaming ( something, I cannot remember ).

    Where is the Photon MicrophoneType located at?
  • NTNU_VR
    NTNU_VR
    edited November 2018
    @matrix211v2 Sorry for answering so late, but if you still haven't found it then It's one of the settings options in the Recorder component.