Photon Voice manual connection and class reference

Options
I have the autoconnect working for PhotonVoice as per the tutorial, but I can't find a how-to for manually connecting and disconnecting. I would like to add it so that I can avoid the connecting if the player has mute voice enabled in my UI. Also, is there a way to mute and unmute the players at runtime? Is there a tutorial or class reference page for this?

Also, where do you store the link to your class reference pages from your website? I can never find it when browsing the tutorials, I always end up Googling the class I need to get to doc-api.

Thanks

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @crystalpug,

    To connect and disconnect manually using Photon Voice client:
    // make use of PhotonServerSettings
                PhotonVoiceNetwork.Connect();
                PhotonVoiceNetwork.Disconnect();
    // total manual control
                PhotonVoiceNetwork.Client.Connect();
                PhotonVoiceNetwork.Client.Disconnect();
    // you will also need to join a room, etc.
                PhotonVoiceNetwork.Client.OpJoinRoom();
    To mute voice you could:

    - as you said: disconnect or not connect at all, saves you CCU and money.
    - unsubscribe from all audio groups: you will still be subscribed to audio group 0, you can avoid using this group to transmit audio and this way you can achieve quick temporary mute by subscribing and unsubscribing from audio groups. This also can achieve "selective muting".
    - use Unity to mute audio, you will still receive it though.

    Currently, we do not have reference docs available for Voice specific API.
    But since Voice API extends LoadBalancing API you could take a look at the .Net Reference API. And since Photon Voice is not tightly coupled with PUN, you could read PUN's reference API as well.
    We are working on making the reference API available for the next major release of Voice.