Class: VoiceClient

Photon.Voice.VoiceClient

Voice API Client.

Methods

createLocalVoice(voiceInfo, encoder) → {Photon.Voice.LocalVoice}

Creates an outgoing stream driven by the Encoder's output() method.

Parameters:
Name Type Description
voiceInfo Photon.Voice.VoiceInfo Stream parameters.
encoder Photon.Voice.Encoder Encoder.
Returns:
Reference to the created outgoing stream.
Type
Photon.Voice.LocalVoice

createLocalVoiceAudio(voiceInfo, sourceSampleRate, sourceChannels) → {Photon.Voice.LocalVoiceAudio}

Creates an outgoing audio stream driven by pushing audio packets with Photon.Voice.LocalVoiceAudio#pushData() call.

Parameters:
Name Type Description
voiceInfo Photon.Voice.VoiceInfo Stream parameters. Stream sample rate may differ from audio source sample rate.
sourceSampleRate number Audio source sample rate.
sourceChannels number Audio source channels count.
Returns:
Reference to the created outgoing audio stream.
Type
Photon.Voice.LocalVoiceAudio

createLocalVoiceAudioFromSource(voiceInfo, audioSource) → {Photon.Voice.LocalVoiceAudio}

Creates an outgoing audio stream receiving audio packets from the audio source.

Parameters:
Name Type Description
voiceInfo Photon.Voice.VoiceInfo Stream parameters. Stream sample rate may differ from audio source sample rate.
audioSource Photon.Voice.AudioSource Audio source for the stream.
Returns:
Reference to the created outgoing audio stream.
Type
Photon.Voice.LocalVoiceAudio

setOnRemoteVoiceInfoAction(userAction)

Sets an action on an incoming stream creation.

Parameters:
Name Type Description
userAction Photon.Voice.OnRemoteVoiceInfoAction A function provided by user.