Photon Voice v2.22.1

Public Member Functions | Properties | List of all members
Speaker Class Reference

Component representing remote audio stream in local scene. More...

Inherits VoiceComponent.

Public Member Functions

bool StartPlayback ()
 Starts the audio playback of the linked incoming remote audio stream via AudioSource component. More...
 
bool StopPlayback ()
 Stops the audio playback of the linked incoming remote audio stream via AudioSource component. More...
 
bool RestartPlayback ()
 Restarts the audio playback of the linked incoming remote audio stream via AudioSource component. More...
 
bool SetPlaybackDelaySettings (PlaybackDelaySettings pdc)
 Sets the settings for the playback behaviour in case of delays. More...
 
bool SetPlaybackDelaySettings (int low, int high, int max)
 Sets the settings for the playback behaviour in case of delays. More...
 

Properties

int PlayDelayMs [get, set]
 
bool IsPlaying [get]
 Is the speaker playing right now. More...
 
int? Lag [get]
 Smoothed difference between (jittering) stream and (clock-driven) audioOutput. More...
 
Action< SpeakerOnRemoteVoiceRemoveAction [get, set]
 Register a method to be called when remote voice removed. More...
 
Realtime.Player Actor [get, set]
 Per room, the connected users/players are represented with a Realtime.Player, also known as Actor. More...
 
bool IsLinked [get]
 Whether or not this Speaker has been linked to a remote voice stream. More...
 
bool PlaybackOnlyWhenEnabled [get, set]
 If true, component will work only when enabled and active in hierarchy. More...
 
bool PlaybackStarted [get]
 Returns if the playback is on. More...
 
int PlaybackDelayMinSoft [get]
 Gets the value in ms above which the audio player tries to keep the delay. More...
 
int PlaybackDelayMaxSoft [get]
 Gets the value in ms below which the audio player tries to keep the delay. More...
 
int PlaybackDelayMaxHard [get]
 Gets the value in ms that audio play delay will not exceed. More...
 
- Properties inherited from VoiceComponent
VoiceLogger Logger [get, protected set]
 
DebugLevel LogLevel [get, set]
 
bool IgnoreGlobalLogLevel [get, set]
 
- Properties inherited from ILoggableDependent
bool IgnoreGlobalLogLevel [get, set]
 
- Properties inherited from ILoggable
DebugLevel LogLevel [get, set]
 
VoiceLogger Logger [get]
 

Additional Inherited Members

- Protected Member Functions inherited from VoiceComponent
virtual void Awake ()
 
- Protected Attributes inherited from VoiceComponent
DebugLevel logLevel = DebugLevel.INFO
 

Detailed Description

Component representing remote audio stream in local scene.

Member Function Documentation

◆ RestartPlayback()

bool RestartPlayback ( )

Restarts the audio playback of the linked incoming remote audio stream via AudioSource component.

Returns
True if playback is successfully restarted.

◆ SetPlaybackDelaySettings() [1/2]

bool SetPlaybackDelaySettings ( int  low,
int  high,
int  max 
)

Sets the settings for the playback behaviour in case of delays.

Parameters
lowIn milliseconds, audio player tries to keep the playback delay above this value.
highIn milliseconds, audio player tries to keep the playback below above this value.
maxIn milliseconds, audio player guarantees that the playback delay never exceeds this value.
Returns
If a change has been made.

◆ SetPlaybackDelaySettings() [2/2]

bool SetPlaybackDelaySettings ( PlaybackDelaySettings  pdc)

Sets the settings for the playback behaviour in case of delays.

Parameters
pdcPlayback delay configuration struct.
Returns
If a change has been made.

◆ StartPlayback()

bool StartPlayback ( )

Starts the audio playback of the linked incoming remote audio stream via AudioSource component.

Returns
True if playback is successfully started.

◆ StopPlayback()

bool StopPlayback ( )

Stops the audio playback of the linked incoming remote audio stream via AudioSource component.

Returns
True if playback is successfully stopped.

Property Documentation

◆ Actor

Realtime.Player Actor
getset

Per room, the connected users/players are represented with a Realtime.Player, also known as Actor.

Photon Voice calls this Actor, to avoid a name-clash with the Player class in Voice.

◆ IsLinked

bool IsLinked
get

Whether or not this Speaker has been linked to a remote voice stream.

◆ IsPlaying

bool IsPlaying
get

Is the speaker playing right now.

◆ Lag

int? Lag
get

Smoothed difference between (jittering) stream and (clock-driven) audioOutput.

◆ OnRemoteVoiceRemoveAction

Action<Speaker> OnRemoteVoiceRemoveAction
getset

Register a method to be called when remote voice removed.

◆ PlaybackDelayMaxHard

int PlaybackDelayMaxHard
get

Gets the value in ms that audio play delay will not exceed.

◆ PlaybackDelayMaxSoft

int PlaybackDelayMaxSoft
get

Gets the value in ms below which the audio player tries to keep the delay.

◆ PlaybackDelayMinSoft

int PlaybackDelayMinSoft
get

Gets the value in ms above which the audio player tries to keep the delay.

◆ PlaybackOnlyWhenEnabled

bool PlaybackOnlyWhenEnabled
getset

If true, component will work only when enabled and active in hierarchy.

◆ PlaybackStarted

bool PlaybackStarted
get

Returns if the playback is on.