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... | |
![]() | |
bool | ConnectUsingSettings (AppSettings overwriteSettings=null) |
Connect to Photon server using Settings More... | |
void | InitRecorder (Recorder rec) |
Initializes the Recorder component to be able to transmit audio. More... | |
void | SetPlaybackDelaySettings (PlaybackDelaySettings gpds) |
Sets the global configuration for the playback behaviour in case of delays. More... | |
void | SetGlobalPlaybackDelaySettings (int low, int high, int max) |
Sets the global configuration for the playback behaviour in case of delays. More... | |
Public Attributes | |
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 | WorkInOfflineMode = true |
Whether or not Photon Voice client should follow PUN client if the latter is in offline mode. More... | |
![]() | |
AppSettings | Settings |
Settings to be used by this voice connection More... | |
Func< int, byte, object, Speaker > | SpeakerFactory |
Special factory to link Speaker components with incoming remote audio streams More... | |
float | MinimalTimeScaleToDispatchInFixedUpdate = -1f |
Configures the minimal Time.timeScale at which Voice client will dispatch incoming messages within LateUpdate. 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... | |
Static Public Attributes | |
const string | VoiceRoomNameSuffix = "_voice_" |
Suffix for voice room names appended to PUN room names. More... | |
Protected Member Functions | |
override void | Awake () |
override void | OnDisable () |
override void | OnDestroy () |
override void | OnVoiceStateChanged (ClientState fromState, ClientState toState) |
override Speaker | SimpleSpeakerFactory (int playerId, byte voiceId, object userData) |
![]() | |
override void | Awake () |
virtual void | Update () |
virtual void | FixedUpdate () |
void | Dispatch () |
Dispatches incoming network messages for Voice client. Called in FixedUpdate or LateUpdate. More... | |
override void | OnDisable () |
void | CalcStatistics () |
void | LinkSpeaker (Speaker speaker, RemoteVoiceLink remoteVoice) |
Properties | |
static PhotonVoiceNetwork | Instance [get, set] |
Singleton instance for PhotonVoiceNetwork More... | |
bool | UsePunAuthValues [get, set] |
Whether or not to use the same PhotonNetwork.AuthValues in PhotonVoiceNetwork.Instance.Client.AuthValues. More... | |
![]() | |
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... | |
Recorder | PrimaryRecorder [get, set] |
Main Recorder to be used for transmission by default More... | |
DebugLevel | GlobalRecordersLogLevel [get, set] |
DebugLevel | GlobalSpeakersLogLevel [get, set] |
int | GlobalPlaybackDelay [get, set] |
string | BestRegionSummaryInPreferences [get, set] |
Used to store and access the "Best Region Summary" in the Player Preferences. More... | |
int | GlobalPlaybackDelayMinSoft [get] |
Gets the global value in ms above which the audio player tries to keep the delay. More... | |
int | GlobalPlaybackDelayMaxSoft [get] |
Gets the global value in ms below which the audio player tries to keep the delay. More... | |
int | GlobalPlaybackDelayMaxHard [get] |
Gets the global value in ms that audio play delay will not exceed. More... | |
![]() | |
DebugLevel | LogLevel [get, set] |
VoiceLogger | Logger [get] |
Additional Inherited Members | |
![]() | |
List< RemoteVoiceLink > | cachedRemoteVoices = new List<RemoteVoiceLink>() |
![]() | |
Action< Speaker > | SpeakerLinked |
Fires when a speaker has been linked to a remote audio stream More... | |
Action< RemoteVoiceLink > | RemoteVoiceAdded |
Fires when a remote voice stream is added More... | |
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.
bool ConnectAndJoinRoom | ( | ) |
void Disconnect | ( | ) |
Disconnect voice client from all Photon servers
bool AutoConnectAndJoin = true |
bool AutoLeaveAndDisconnect = true |
|
static |
Suffix for voice room names appended to PUN room names.
bool WorkInOfflineMode = true |
|
staticgetset |
Singleton instance for PhotonVoiceNetwork
|
getset |
Whether or not to use the same PhotonNetwork.AuthValues in PhotonVoiceNetwork.Instance.Client.AuthValues.