Photon Voice: PhotonVoiceNetwork Class Reference

Photon Voice

This class can be used to automatically sync client states between PUN and Voice. It also sets a custom PUN Speaker factory to find 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 VoiceConnection.

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
bool ConnectUsingSettings (AppSettings overwriteSettings=null)
 Connect to Photon server using Settings More...
 

Public Attributes

const string VoiceRoomNameSuffix = "_voice_"
 Suffix for voice room names appended to PUN room names. More...
 
bool AutoConnectAndJoin = true
 Auto connect voice client and join a voice room when PUN client is joined to a PUN room More...
 
bool AutoLeaveAndDisconnect = true
 Auto disconnect voice client when PUN client is not joined to a PUN room More...
 
bool AutoCreateSpeakerIfNotFound = true
 Auto instantiate a GameObject and attach a Speaker component to link to a remote audio stream if no candidate could be found More...
 
- Public Attributes inherited from VoiceConnection
AppSettings Settings
 Settings to be used by this voice connection More...
 
Recorder PrimaryRecorder
 Main Recorder to be used for transmission by default More...
 
Func< int, byte, object, SpeakerSpeakerFactory
 Special factory to link Speaker components with incoming remote audio streams More...
 

Protected Member Functions

override void Awake ()
 
override void OnApplicationQuit ()
 
override void OnDestroy ()
 
override void OnVoiceStateChanged (ClientState fromState, ClientState toState)
 
override Speaker SimpleSpeakerFactory (int playerId, byte voiceId, object userData)
 
- Protected Member Functions inherited from VoiceConnection
override void Awake ()
 
virtual void Update ()
 
virtual void FixedUpdate ()
 
override void OnDestroy ()
 
override void OnApplicationQuit ()
 
void CalcStatistics ()
 
void LinkSpeaker (Speaker speaker, RemoteVoiceLink remoteVoice)
 

Properties

static PhotonVoiceNetwork Instance [get, set]
 Singleton instance for PhotonVoiceNetwork More...
 
- Properties inherited from VoiceConnection
VoiceLogger Logger [get, protected set]
 Logger used by this component More...
 
DebugLevel LogLevel [get, set]
 Log level for this component More...
 
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...
 
- Properties inherited from ILoggable
DebugLevel LogLevel [get, set]
 
VoiceLogger Logger [get]
 

Additional Inherited Members

- Protected Attributes inherited from VoiceConnection
List< RemoteVoiceLinkcachedRemoteVoices = new List<RemoteVoiceLink>()
 
- 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 sets a custom PUN Speaker factory to find 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 Function Documentation

bool ConnectAndJoinRoom ( )

Connect voice client to Photon servers and join a Voice room

Returns
If true, connection command send from client
void Disconnect ( )

Disconnect voice client from all Photon servers

Member Data Documentation

bool AutoConnectAndJoin = true

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

bool AutoCreateSpeakerIfNotFound = true

Auto instantiate a GameObject and attach a Speaker component to link to a remote audio stream if no candidate could be found

bool AutoLeaveAndDisconnect = true

Auto disconnect voice client when PUN client is not joined to a PUN room

const string VoiceRoomNameSuffix = "_voice_"

Suffix for voice room names appended to PUN room names.

Property Documentation

PhotonVoiceNetwork Instance
staticgetset

Singleton instance for PhotonVoiceNetwork

Online Documentation  -  Dashboard  -  Support Forum Exit Games GmbH