Photon Voice v2.53

Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
VoiceFollowClient Class Referenceabstract

This class can be used to automatically sync client states between Leader and Voice clients. More...

Inherits VoiceConnection.

Inherited by FusionVoiceClient, and PunVoiceClient.

Public Member Functions

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

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...
 

Protected Member Functions

abstract string GetVoiceRoomName ()
 
abstract bool ConnectVoice ()
 
virtual void Start ()
 
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 ()
 
virtual Speaker InstantiateSpeakerForRemoteVoice (int playerId, byte voiceId, object userData)
 
void CalcStatistics ()
 

Properties

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

- 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 Attributes inherited from VoiceConnection
Voice.ILogger Logger => voiceComponentImpl.Logger
 
- 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 Leader and Voice clients.

Member Function Documentation

◆ ConnectAndJoinRoom()

bool ConnectAndJoinRoom ( )

Connect voice client to Photon servers and join a Voice room

Returns
If true, connection command send from client

◆ Disconnect()

void Disconnect ( )

Disconnect voice client from all Photon servers

Member Data Documentation

◆ AutoConnectAndJoin

bool AutoConnectAndJoin = true

Auto connect voice client and join a voice room when Leader client is joined to a Leader room