PUN Voice Push To Talk Demo not work

Hello , i am try demo "PUN Voice Push To Talk Demo" , but not work i am following all steps (APPID , Voice APP ID )
unity version : 2018.1.6f1
Build : Android

Screen_Shot_2018_08_12_at_2_04_08_PM

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited August 2018
    Hi @mahmoud93p,

    Thank you for reporting this!

    I could not reproduce the issue you have reported.
    Could you tell us how to reproduce it?

    In the meantime you could fix it by simply doing the following and trying again:
    In the file "PushToTalkScript.cs" at the end/bottom, replace PushToTalkScript.SubscribeToAllPrivateGroups and PushToTalkScript.KeepOnlyOneGroup methods with the following:

    private void SubscribeToAllPrivateGroups()
            {
                PhotonVoiceNetwork.Client.ChangeAudioGroups(null, new byte[0]);
                for (int i = 0; i < PhotonNetwork.otherPlayers.Length; i++)
                {
                    if (!buttons.ContainsKey(PhotonNetwork.otherPlayers[i].ID))
                    {
                        if (PhotonNetwork.otherPlayers[i].IsInactive)
                        {
                            continue;
                        }
                        Debug.LogWarningFormat("PTT Button not found for player number {0}", PhotonNetwork.otherPlayers[i].ID);
                        OnPhotonPlayerConnected(PhotonNetwork.otherPlayers[i]);
                    }
                    // mark other AudioGroups as subscribed
                    buttons[PhotonNetwork.otherPlayers[i].ID].Subscribed = true;
                }
            }
    
            private void KeepOnlyOneGroup(byte group)
            {
                for (int i = 0; i < PhotonNetwork.otherPlayers.Length; i++)
                {
                    if (!buttons.ContainsKey(PhotonNetwork.otherPlayers[i].ID)) 
                    {
                        if (PhotonNetwork.otherPlayers[i].IsInactive)
                        {
                            continue;
                        }
                        Debug.LogWarningFormat("PTT Button not found for player number {0}", PhotonNetwork.otherPlayers[i].ID);
                        OnPhotonPlayerConnected(PhotonNetwork.otherPlayers[i]);
                    }
                    // mark other AudioGroups as unsubscribed
                    if (buttons[PhotonNetwork.otherPlayers[i].ID].AudioGroup != group)
                    {
                        buttons[PhotonNetwork.otherPlayers[i].ID].Subscribed = false;
                    }
                    else
                    {
                        PhotonVoiceNetwork.Client.GlobalAudioGroup = group;
                        buttons[PhotonNetwork.otherPlayers[i].ID].Subscribed = true;
                    }
                }
            }
  • @JohnTube i very sorry , i put chat app id in voice app id , everything is work .