Hi, I am using PhotonNetwork.Instantiate to create player avatars on the local device and to all clients in the OnJoinedRoom callback. This prefab has several PhotonViews to sync various gameobjects position and rotation. I also have Photon Voice running based on the DemoVoice scene so I have a GameObject with a VoiceConnection, Recorder, Connect and Join and Web Rtc Audio Disp components.
Both parts of this are working however I now need to know which players are speaking and I thought i should be able to use a PhotonVoiceView on the player prefab to tell me this. However it doesn't seem to be working - i.e. the IsSpeaker and IsRecording are always false. Do I need to do anything else to connect the two together?
In my digging around trying to solve this I ended up adding a PhotonVoiceNetwork as well. At the top of cs file it says:
// It also sets a custom PUN Speaker factory to find the Speaker
// component for a character's voice. For this to work, the voice's UserData
// must be set to the character's PhotonView ID.
I am not sure if I need to do something extra in my code to set the Voice's UserData or should I be using PhotonVoiceNetwork at all? This component also seems to duplicate some of the functionaity of VoiceConnection. At the moment I am not using the SpeakerPrefab setting to create my player avatars but should I be?
I am a bit confused as to what should be happening where and what Components I should be using. Can you please advise as to the best way to achieve this?
Thanks.
Both parts of this are working however I now need to know which players are speaking and I thought i should be able to use a PhotonVoiceView on the player prefab to tell me this. However it doesn't seem to be working - i.e. the IsSpeaker and IsRecording are always false. Do I need to do anything else to connect the two together?
In my digging around trying to solve this I ended up adding a PhotonVoiceNetwork as well. At the top of cs file it says:
// It also sets a custom PUN Speaker factory to find the Speaker
// component for a character's voice. For this to work, the voice's UserData
// must be set to the character's PhotonView ID.
I am not sure if I need to do something extra in my code to set the Voice's UserData or should I be using PhotonVoiceNetwork at all? This component also seems to duplicate some of the functionaity of VoiceConnection. At the moment I am not using the SpeakerPrefab setting to create my player avatars but should I be?
I am a bit confused as to what should be happening where and what Components I should be using. Can you please advise as to the best way to achieve this?
Thanks.