Photon Voice v2.53

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

Represents outgoing data stream. More...

Inherits IDisposable.

Inherited by LocalVoiceAudioDummy, and LocalVoiceFramed< T >.

Public Member Functions

void SendSpacingProfileStart ()
 
void RemoveSelf ()
 Remove this voice from it's VoiceClient (using VoiceClient.RemoveLocalVoice More...
 
virtual void Dispose ()
 

Static Public Attributes

const int DATA_POOL_CAPACITY = 50
 

Protected Member Functions

bool targetExits (bool targetMe, int[] targetPlayers)
 
void sendVoiceInfoAndConfigFrame (bool targetMe, int[] targetPlayers)
 
void sendVoiceRemove (bool targetMe, int[] targetPlayers)
 

Protected Attributes

int[] targetPlayers_
 
VoiceInfo info
 
IEncoder encoder
 
VoiceClient voiceClient
 
bool threadingEnabled
 
ArraySegment< byte > configFrame
 
volatile bool disposed
 
object disposeLock = new object()
 
bool isJoined => voiceClient != null && voiceClient.transport.IsChannelJoined(this.channelId)
 

Properties

VoiceInfo Info [get]
 Returns Info structure assigned on local voice cration. More...
 
bool TransmitEnabled [get, set]
 If true, stream data broadcasted. More...
 
bool IsCurrentlyTransmitting [get]
 Returns true if stream broadcasts. More...
 
int FramesSent [get]
 Sent frames counter. More...
 
int FramesSentFragmented [get]
 Sent fragmented frames counter. More...
 
int FramesSentFragments [get]
 Sent frames fragments counter. More...
 
int FramesSentBytes [get]
 Sent frames bytes counter. More...
 
bool Reliable [get, set]
 Send data reliable. See also VoiceCreateOptions.Reliable. More...
 
bool Encrypt [get, set]
 Send data encrypted. See also VoiceCreateOptions.Encrypt. More...
 
bool Fragment [get, set]
 Split frames into fragments according to the size provided by the Transport. See also VoiceCreateOptions.Fragment. More...
 
int FEC [get, set]
 Forward Error Correction control. See also VoiceCreateOptions.FEC. More...
 
IServiceable LocalUserServiceable [get, set]
 Optional user object attached to LocalVoice. its Service() will be called at each VoiceClient.Service() call. More...
 
byte Group [get, set]
 
byte InterestGroup [get, set]
 If InterestGroup != 0, streaming only to the players subscribed to this group (if supported by the transport). See also VoiceCreateOptions.InterestGroup. More...
 
bool DebugEchoMode [get, set]
 If true, outgoing stream routed back to client via server same way as for remote client's streams. See also VoiceCreateOptions.DebugEchoMode. More...
 
int[]?? TargetPlayers [get, set]
 If TargetPlayers is not null, sending voice info and streaming only to clients having player numbers specified in the array (if supported by transport). See also VoiceCreateOptions.TargetPlayers. More...
 
string SendSpacingProfileDump [get]
 
int SendSpacingProfileMax [get]
 Logs input frames time spacing profiling results. Do not call frequently. More...
 
byte ID [get]
 
byte EvNumber [get]
 
string shortName [get]
 
string Name [get]
 
string LogPrefix [get]
 

Detailed Description

Represents outgoing data stream.

Member Function Documentation

◆ RemoveSelf()

void RemoveSelf ( )

Remove this voice from it's VoiceClient (using VoiceClient.RemoveLocalVoice

Property Documentation

◆ DebugEchoMode

bool DebugEchoMode
getset

If true, outgoing stream routed back to client via server same way as for remote client's streams. See also VoiceCreateOptions.DebugEchoMode.

This functionality availability depends on transport.

◆ Encrypt

bool Encrypt
getset

Send data encrypted. See also VoiceCreateOptions.Encrypt.

◆ FEC

int FEC
getset

Forward Error Correction control. See also VoiceCreateOptions.FEC.

◆ Fragment

bool Fragment
getset

Split frames into fragments according to the size provided by the Transport. See also VoiceCreateOptions.Fragment.

◆ FramesSent

int FramesSent
get

Sent frames counter.

◆ FramesSentBytes

int FramesSentBytes
get

Sent frames bytes counter.

◆ FramesSentFragmented

int FramesSentFragmented
get

Sent fragmented frames counter.

◆ FramesSentFragments

int FramesSentFragments
get

Sent frames fragments counter.

◆ Info

VoiceInfo Info
get

Returns Info structure assigned on local voice cration.

◆ InterestGroup

byte InterestGroup
getset

If InterestGroup != 0, streaming only to the players subscribed to this group (if supported by the transport). See also VoiceCreateOptions.InterestGroup.

A remote voice is created even if the remote player is not subscribed to the InterestGroup. Use VoiceCreateOptions.TargetPlayers and TargetPlayers to completely hide the existence of LocalVoice from the remote player./>

◆ IsCurrentlyTransmitting

bool IsCurrentlyTransmitting
get

Returns true if stream broadcasts.

◆ LocalUserServiceable

IServiceable LocalUserServiceable
getset

Optional user object attached to LocalVoice. its Service() will be called at each VoiceClient.Service() call.

◆ Reliable

bool Reliable
getset

Send data reliable. See also VoiceCreateOptions.Reliable.

◆ SendSpacingProfileMax

int SendSpacingProfileMax
get

Logs input frames time spacing profiling results. Do not call frequently.

◆ TargetPlayers

int []?? TargetPlayers
getset

If TargetPlayers is not null, sending voice info and streaming only to clients having player numbers specified in the array (if supported by transport). See also VoiceCreateOptions.TargetPlayers.

TargetPlayers update triggers the sending of voice info to added players and voice remove to removed. Depending on the transport, TargetPlayers may disregard InterestGroup: the remote player whos number is in TargetPlayers, receives the stream even if not subscribed to the interest group. If the local player number is in TargetPlayers, it works like DebugEchoMode. Using both DebugEchoMode and TargetPlayers at the same time to route the stream back to the sender leads to an inconsistent state after one of the options is switched off: the voice is removed but the frames are still delivered.

◆ TransmitEnabled

bool TransmitEnabled
getset

If true, stream data broadcasted.