PUN Voice Push To Talk Demo not work
in Photon Voice
Comments
-
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, replacePushToTalkScript.SubscribeToAllPrivateGroups
andPushToTalkScript.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; } } }
1 -
@JohnTube i very sorry , i put chat app id in voice app id , everything is work .0