Photon Voice v2.53

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

Inherits VoiceComponent.

Inherited by SpeakerFMOD, and SpeakerAudioFilterRead.

Public Member Functions

void RestartPlayback ()
 Restarts the audio playback of the linked incoming remote audio stream via AudioSource component. More...
 

Protected Member Functions

override void Awake ()
 
virtual IAudioOut< float > CreateAudioOut ()
 
virtual void OnDestroy ()
 
void Update ()
 

Protected Attributes

IAudioOut< float > audioOutput
 
AudioOutDelayControl.PlayDelayConfig playDelayConfig = AudioOutDelayControl.PlayDelayConfig.Default
 
bool restartOnDeviceChange = true
 
- Protected Attributes inherited from VoiceComponent
Voice.ILogger Logger => impl.Logger
 

Properties

bool IsPlaying [get]
 Is the speaker playing right now. More...
 
int? Lag [get]
 The current difference between positions in the buffer of (jittery) stream writer and (clock-driven) audio output reader in ms. More...
 
Action< SpeakerOnRemoteVoiceRemoveAction [get, set]
 Register a method to be called when remote voice removed. More...
 
RemoteVoiceLink RemoteVoice [get]
 
bool IsLinked [get]
 Whether or not this Speaker has been linked to a remote voice stream. More...
 
AudioOutDelayControl.PlayDelayConfig PlayDelayConfig [get, set]
 Gets or sets jitter buffer config. More...
 
int PlayDelay [get, set]
 Gets or sets jitter buffer size in ms. More...
 
bool RestartOnDeviceChange [get, set]
 
- Properties inherited from VoiceComponent
string Name [set]
 

Additional Inherited Members

- Public Attributes inherited from VoiceComponent
VoiceLogger VoiceLogger => impl.VoiceLogger
 

Member Function Documentation

◆ RestartPlayback()

void RestartPlayback ( )

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

Returns
True if playback is successfully restarted.

Property Documentation

◆ 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

The current difference between positions in the buffer of (jittery) stream writer and (clock-driven) audio output reader in ms.

◆ OnRemoteVoiceRemoveAction

Action<Speaker> OnRemoteVoiceRemoveAction
getset

Register a method to be called when remote voice removed.

◆ PlayDelay

int PlayDelay
getset

Gets or sets jitter buffer size in ms.

The method updates PlayDelayConfig with reasonable values based on the single value provided. Use PlayDelayConfig for more precise control.

◆ PlayDelayConfig

AudioOutDelayControl.PlayDelayConfig PlayDelayConfig
getset

Gets or sets jitter buffer config.

Make sure that the new value is fully initialized or built from AudioOutDelayControl.PlayDelayConfig.Default.