Photon Voice v2.53

Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
PunVoiceClient Class Reference

This class can be used to automatically sync client states between PUN and Voice. It also finds the Speaker component for a character's voice. For this to work attach a PhotonVoiceView next to the PhotonView of your player's prefab. More...

Inherits VoiceFollowClient.

Static Public Attributes

const string VoiceRoomNameSuffix = "_voice_"
 Suffix for voice room names appended to Leader room names. More...
 
- Static Public Attributes inherited from VoiceConnection
const int ChannelAudio = 1
 Recommended Photon Transport channel for audio. Chosen not to interfere with video and default channel. More...
 
const int ChannelVideo = 2
 Recommended Photon Transport channel for video. Chosen not to interfere with audio and default channel. More...
 

Protected Member Functions

override void Start ()
 
override void OnDestroy ()
 
override Speaker InstantiateSpeakerForRemoteVoice (int playerId, byte voiceId, object userData)
 
override string GetVoiceRoomName ()
 
override bool ConnectVoice ()
 
- Protected Member Functions inherited from VoiceFollowClient
override void OnDestroy ()
 
override void OnOperationResponseReceived (OperationResponse operationResponse)
 
void LeaderStateChanged (ClientState toState)
 
override void OnVoiceStateChanged (ClientState fromState, ClientState toState)
 
- Protected Member Functions inherited from VoiceConnection
override void Awake ()
 
virtual void Update ()
 
virtual void FixedUpdate ()
 
void CalcStatistics ()
 

Protected Attributes

override bool LeaderInRoom => PhotonNetwork.InRoom
 
override bool LeaderOfflineMode => PhotonNetwork.OfflineMode
 
- Protected Attributes inherited from VoiceConnection
Voice.ILogger Logger => voiceComponentImpl.Logger
 

Properties

static PunVoiceClient Instance [get]
 Singleton instance for PunVoiceClient More...
 
bool UsePunAppSettings [get, set]
 Whether or not to use the Voice AppId and all the other AppSettings from PUN's PhotonServerSettings ScriptableObject singleton in the Voice client/app. More...
 
bool UsePunAuthValues [get, set]
 Whether or not to use the same PhotonNetwork.AuthValues in PunVoiceClient.Instance.Client.AuthValues. This means that the same UserID will be used in both clients. If custom authentication is used and setup in PUN app, the same configuration should be done for the Voice app. More...
 
- Properties inherited from VoiceFollowClient
abstract bool LeaderInRoom [get]
 
abstract bool LeaderOfflineMode [get]
 
- Properties inherited from VoiceConnection
new LoadBalancingTransport Client [get]
 
VoiceClient VoiceClient [get]
 Returns underlying Photon Voice client. More...
 
ClientState ClientState [get]
 Returns Photon Voice client state. More...
 
float FramesReceivedPerSecond [get]
 Number of frames received per second. More...
 
float FramesLostPerSecond [get]
 Number of frames lost per second. More...
 
float FramesLostPercent [get]
 Percentage of lost frames. More...
 
GameObject SpeakerPrefab [get, set]
 Prefab that contains Speaker component to be instantiated when receiving a new remote audio source info More...
 
Recorder PrimaryRecorder [get, set]
 Primary Recorder to be used by VoiceConnection implementations directly or via integration objects. More...
 
string BestRegionSummaryInPreferences [get, set]
 Used to store and access the "Best Region Summary" in the Player Preferences. More...
 

Additional Inherited Members

- Public Member Functions inherited from VoiceFollowClient
bool ConnectAndJoinRoom ()
 Connect voice client to Photon servers and join a Voice room More...
 
void Disconnect ()
 Disconnect voice client from all Photon servers More...
 
- Public Member Functions inherited from VoiceConnection
virtual bool ConnectUsingSettings (AppSettings overwriteSettings=null)
 Connect to Photon server using Settings More...
 
bool AddSpeaker (Speaker speaker, object userData)
 Tries to link local Speaker with remote voice stream using UserData. Useful if Speaker created after stream is started. More...
 
Speaker InstantiateSpeakerPrefab (GameObject parent, bool destroyOnRemove)
 Instantiates SpeakerPrefab, optionally attaches it to the provided parent. More...
 
bool AddRecorder (Recorder rec)
 
void RemoveRecorder (Recorder rec)
 
- Public Attributes inherited from VoiceFollowClient
bool AutoConnectAndJoin = true
 Auto connect voice client and join a voice room when Leader client is joined to a Leader room More...
 
- Public Attributes inherited from VoiceConnection
virtual bool AlwaysUsePrimaryRecorder => false
 
AppSettings Settings
 Settings to be used by this Voice Client More...
 
VoiceLogger VoiceLogger => voiceComponentImpl.VoiceLogger
 
bool UsePrimaryRecorder => this.usePrimaryRecorder
 Use VoiceConnection.PrimaryRecorder directly. More...
 
- Events inherited from VoiceConnection
Action< SpeakerSpeakerLinked
 Fires when a speaker has been linked to a remote audio stream More...
 
Action< RemoteVoiceLinkRemoteVoiceAdded
 Fires when a remote voice stream is added More...
 

Detailed Description

This class can be used to automatically sync client states between PUN and Voice. It also finds the Speaker component for a character's voice. For this to work attach a PhotonVoiceView next to the PhotonView of your player's prefab.

Member Data Documentation

◆ VoiceRoomNameSuffix

const string VoiceRoomNameSuffix = "_voice_"
static

Suffix for voice room names appended to Leader room names.

Property Documentation

◆ Instance

PunVoiceClient Instance
staticget

Singleton instance for PunVoiceClient

◆ UsePunAppSettings

bool UsePunAppSettings
getset

Whether or not to use the Voice AppId and all the other AppSettings from PUN's PhotonServerSettings ScriptableObject singleton in the Voice client/app.

◆ UsePunAuthValues

bool UsePunAuthValues
getset

Whether or not to use the same PhotonNetwork.AuthValues in PunVoiceClient.Instance.Client.AuthValues. This means that the same UserID will be used in both clients. If custom authentication is used and setup in PUN app, the same configuration should be done for the Voice app.