Component that represents a client voice connection to Photon Servers.
More...
Inherits ConnectionHandler, and ILoggable.
Inherited by PhotonVoiceNetwork.
|
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 () |
|
virtual void | OnDestroy () |
|
virtual Speaker | SimpleSpeakerFactory (int playerId, byte voiceId, object userData) |
|
virtual void | OnVoiceStateChanged (ClientState fromState, ClientState toState) |
|
void | CalcStatistics () |
|
void | LinkSpeaker (Speaker speaker, RemoteVoiceLink remoteVoice) |
|
Component that represents a client voice connection to Photon Servers.
◆ ConnectUsingSettings()
bool ConnectUsingSettings |
( |
AppSettings |
overwriteSettings = null | ) |
|
Connect to Photon server using Settings
- Parameters
-
overwriteSettings | Overwrites Settings before connecting |
- Returns
- If true voice connection command was sent from client
◆ Dispatch()
Dispatches incoming network messages for Voice client. Called in FixedUpdate or LateUpdate.
It may make sense to dispatch incoming messages, even if the timeScale is near 0. That can be configured with MinimalTimeScaleToDispatchInFixedUpdate.
Without dispatching messages, Voice client won't change state and does not handle updates.
◆ InitRecorder()
Initializes the Recorder component to be able to transmit audio.
- Parameters
-
◆ SetGlobalPlaybackDelaySettings()
void SetGlobalPlaybackDelaySettings |
( |
int |
low, |
|
|
int |
high, |
|
|
int |
max |
|
) |
| |
Sets the global configuration for the playback behaviour in case of delays.
- Parameters
-
low | In milliseconds, audio player tries to keep the playback delay above this value. |
high | In milliseconds, audio player tries to keep the playback below above this value. |
max | In milliseconds, audio player guarantees that the playback delay never exceeds this value. |
◆ SetPlaybackDelaySettings()
Sets the global configuration for the playback behaviour in case of delays.
- Parameters
-
gpds | Playback delay configuration struct. |
◆ AutoCreateSpeakerIfNotFound
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
◆ MinimalTimeScaleToDispatchInFixedUpdate
float MinimalTimeScaleToDispatchInFixedUpdate = -1f |
Configures the minimal Time.timeScale at which Voice client will dispatch incoming messages within LateUpdate.
It may make sense to dispatch incoming messages, even if the timeScale is near 0. In some cases, stopping the game time makes sense, so this option defaults to -1f, which is "off". Without dispatching messages, Voice client won't change state and does not handle updates.
◆ Settings
Settings to be used by this voice connection
◆ SpeakerFactory
Func<int, byte, object, Speaker> SpeakerFactory |
Special factory to link Speaker components with incoming remote audio streams
◆ BestRegionSummaryInPreferences
string BestRegionSummaryInPreferences |
|
getset |
Used to store and access the "Best Region Summary" in the Player Preferences.
◆ ClientState
◆ FramesLostPercent
Percentage of lost frames.
◆ FramesLostPerSecond
float FramesLostPerSecond |
|
get |
Number of frames lost per second.
◆ FramesReceivedPerSecond
float FramesReceivedPerSecond |
|
get |
Number of frames received per second.
◆ GlobalPlaybackDelayMaxHard
int GlobalPlaybackDelayMaxHard |
|
get |
Gets the global value in ms that audio play delay will not exceed.
◆ GlobalPlaybackDelayMaxSoft
int GlobalPlaybackDelayMaxSoft |
|
get |
Gets the global value in ms below which the audio player tries to keep the delay.
◆ GlobalPlaybackDelayMinSoft
int GlobalPlaybackDelayMinSoft |
|
get |
Gets the global value in ms above which the audio player tries to keep the delay.
◆ Logger
◆ LogLevel
Log level for this component
◆ PrimaryRecorder
Main Recorder to be used for transmission by default
◆ SpeakerPrefab
Prefab that contains Speaker component to be instantiated when receiving a new remote audio source info
◆ VoiceClient
◆ RemoteVoiceAdded
Fires when a remote voice stream is added
◆ SpeakerLinked
Fires when a speaker has been linked to a remote audio stream