Photon C++ Client API
5.0.7.3
|
Voice client interacts with other clients on network via IVoiceTransport. More...
Public Types | |
typedef void() | RemoteVoiceInfoCallback(void *opaque, int channelId, int playerId, nByte voiceId, const VoiceInfo &voiceInfo, RemoteVoiceOptions &options) |
Public Member Functions | |||
VoiceClient (IVoiceTransport *transport) | |||
Creates VoiceClient instance More... | |||
void | setOnRemoteVoiceInfoAction (void *opaque, RemoteVoiceInfoCallback *callback) | ||
Register a method to be called when remote voice info arrived (after join or new new remote voice creation). Metod parameters: (int channelId, int playerId, byte voiceId, VoiceInfo voiceInfo, ref RemoteVoiceOptions options); More... | |||
void | service (void) | ||
This method dispatches all available incoming commands and then sends this client's outgoing commands. Call this method regularly (2..20 times a second). More... | |||
IVoiceTransport * | getTransport (void) const | ||
void | forEachLocalVoice (void *opaque, void(*op)(void *, const LocalVoice &)) const | ||
void | forEachLocalVoiceInChannel (int channelId, void *opaque, void(*op)(void *, const LocalVoice &)) const | ||
Returns copies of all local voices for given channel. More... | |||
Common::JVector< RemoteVoiceInfo > | getRemoteVoiceInfos (void) const | ||
Iterates through all remote voices infos. More... | |||
int | getFramesLost (void) const | ||
Lost frames counter. More... | |||
int | getFramesReceived (void) const | ||
Received frames counter. More... | |||
int | getFramesSent (void) const | ||
Sent frames counter. More... | |||
int | getFramesSentBytes (void) const | ||
Sent frames bytes counter. More... | |||
int | getRoundTripTime (void) const | ||
Average time required voice packet to return to sender. More... | |||
int | getRoundTripTimeVariance (void) const | ||
Average round trip time variation. More... | |||
bool | getSuppressInfoDuplicateWarning (void) const | ||
Do not log warning when duplicate info received. More... | |||
void | setSuppressInfoDuplicateWarning (bool yes) | ||
int | getDebugLostPercent (void) const | ||
Lost frames simulation ratio. More... | |||
void | setDebugLostPercent (int debugLostPercent) | ||
LocalVoice * | createLocalVoice (const VoiceInfo &voiceInfo, int channelId=0, Common::Helpers::SharedPointer< IEncoder > encoder=static_cast< IEncoder * >(NULL)) | ||
Creates basic outgoing stream w/o data processing support. Provided encoder should generate output data stream. More... | |||
template<typename T > | |||
LocalVoiceFramed< T > * | createLocalVoiceFramed (const VoiceInfo &voiceInfo, int frameSize, int channelId=0, Common::Helpers::SharedPointer< IEncoder > encoder=static_cast< IEncoder * >(NULL)) | ||
Creates outgoing stream consuming sequence of values passed in array buffers of arbitrary length which repacked in frames of constant length for further processing and encoding. More... | |||
template<typename T > | |||
LocalVoiceAudio< T > * | createLocalVoiceAudio (const VoiceInfo &voiceInfo, const IAudioDesc &audioSourceDesc, int channelId=0, Common::Helpers::SharedPointer< IEncoder > encoder=static_cast< IEncoder * >(NULL)) | ||
Creates outgoing audio stream. Adds audio specific features (e.g. resampling, level meter) to processing pipeline and to returning stream handler. More... | |||
template<typename T > | |||
LocalVoiceAudio< T > * | createLocalVoiceAudioFromSource (const VoiceInfo &voiceInfo, IAudioPusher< T > *source, int channelId=0, Common::Helpers::SharedPointer< IEncoder > encoder=static_cast< IEncoder * >(NULL)) | ||
Creates outgoing audio stream. Adds audio specific features (e.g. resampling, level meter) to processing pipeline and to returning stream handler. More... | |||
void | removeLocalVoice (LocalVoice &voice) | ||
Removes local voice (outgoing data stream).
| |||
Common::JString | channelStr (int channelId) | ||
Common::JString | playerStr (int playerId) | ||
void | onJoinChannel (int channel) | ||
void | onLeaveChannel (int channel) | ||
void | onLeaveAllChannels () | ||
void | onPlayerJoin (int channelId, int playerId) | ||
void | onPlayerLeave (int channelId, int playerId) | ||
void | onVoiceInfo (int channelId, int playerId, nByte voiceId, nByte eventNumber, const VoiceInfo &info) | ||
void | onVoiceRemove (int channelId, int playerId, const Common::JVector< nByte > &voiceIds) | ||
nByte | getGlobalInterestGroup (void) const | ||
void | setGlobalInterestGroup (nByte group) | ||
void | onFrame (int channelId, int playerId, nByte voiceId, nByte evNumber, Buffer< nByte > receivedBytes, bool isLocalPlayer) | ||
Voice client interacts with other clients on network via IVoiceTransport.
VoiceClient | ( | IVoiceTransport * | transport | ) |
Creates VoiceClient instance
void setOnRemoteVoiceInfoAction | ( | void * | opaque, |
VoiceClient::RemoteVoiceInfoCallback * | callback | ||
) |
Register a method to be called when remote voice info arrived (after join or new new remote voice creation). Metod parameters: (int channelId, int playerId, byte voiceId, VoiceInfo voiceInfo, ref RemoteVoiceOptions options);
void service | ( | void | ) |
This method dispatches all available incoming commands and then sends this client's outgoing commands. Call this method regularly (2..20 times a second).
void forEachLocalVoiceInChannel | ( | int | channelId, |
void * | opaque, | ||
void(*)(void *, const LocalVoice &) | op | ||
) | const |
Returns copies of all local voices for given channel.
JVector< RemoteVoiceInfo > getRemoteVoiceInfos | ( | void | ) | const |
Iterates through all remote voices infos.
int getFramesLost | ( | void | ) | const |
Lost frames counter.
int getFramesReceived | ( | void | ) | const |
Received frames counter.
int getFramesSent | ( | void | ) | const |
Sent frames counter.
int getFramesSentBytes | ( | void | ) | const |
Sent frames bytes counter.
int getRoundTripTime | ( | void | ) | const |
Average time required voice packet to return to sender.
int getRoundTripTimeVariance | ( | void | ) | const |
Average round trip time variation.
bool getSuppressInfoDuplicateWarning | ( | void | ) | const |
Do not log warning when duplicate info received.
int getDebugLostPercent | ( | void | ) | const |
Lost frames simulation ratio.
LocalVoice * createLocalVoice | ( | const VoiceInfo & | voiceInfo, |
int | channelId = 0 , |
||
Common::Helpers::SharedPointer< IEncoder > | encoder = static_cast<IEncoder*>(NULL) |
||
) |
Creates basic outgoing stream w/o data processing support. Provided encoder should generate output data stream.
voiceInfo | Outgoing stream parameters. Set applicable fields to read them by encoder and by receiving client when voice created. |
channelId | Transport channel specific to transport. |
encoder | Encoder producing the stream. |
LocalVoiceFramed< T > * createLocalVoiceFramed | ( | const VoiceInfo & | voiceInfo, |
int | frameSize, | ||
int | channelId = 0 , |
||
Common::Helpers::SharedPointer< IEncoder > | encoder = static_cast<IEncoder*>(NULL) |
||
) |
Creates outgoing stream consuming sequence of values passed in array buffers of arbitrary length which repacked in frames of constant length for further processing and encoding.
T | Type of data consumed by outgoing stream (element type of array buffers). |
voiceInfo | Outgoing stream parameters. Set applicable fields to read them by encoder and by receiving client when voice created. |
frameSize | Size of buffer LocalVoiceFramed repacks input data stream to. |
channelId | Transport channel specific to transport. |
encoder | Encoder compressing data stream in pipeline. |
LocalVoiceAudio< T > * createLocalVoiceAudio | ( | const VoiceInfo & | voiceInfo, |
const IAudioDesc & | audioSourceDesc, | ||
int | channelId = 0 , |
||
Common::Helpers::SharedPointer< IEncoder > | encoder = static_cast<IEncoder*>(NULL) |
||
) |
Creates outgoing audio stream. Adds audio specific features (e.g. resampling, level meter) to processing pipeline and to returning stream handler.
T | Element type of audio array buffers. |
voiceInfo | Outgoing audio stream parameters. Set applicable fields to read them by encoder and by receiving client when voice created. |
audioSourceDesc | Streaming audio source description. |
channelId | Transport channel specific to transport. |
encoder | Audio encoder. Set to null to use default Opus encoder. |
Sampling rates of audioSourceDesc voiceInfo may do not match. Automatic resampling will occur in this case.
LocalVoiceAudio< T > * createLocalVoiceAudioFromSource | ( | const VoiceInfo & | voiceInfo, |
IAudioPusher< T > * | source, | ||
int | channelId = 0 , |
||
Common::Helpers::SharedPointer< IEncoder > | encoder = static_cast<IEncoder*>(NULL) |
||
) |
Creates outgoing audio stream. Adds audio specific features (e.g. resampling, level meter) to processing pipeline and to returning stream handler.
voiceInfo | Outgoing audio stream parameters. Set applicable fields to read them by encoder and by receiving client when voice created. |
source | Streaming audio source. |
channelId | Transport channel specific to transport. |
encoder | Audio encoder. Set to null to use default Opus encoder. |
Sampling rates of audioSourceDesc voiceInfo may do not match. Automatic resampling will occur in this case.
void removeLocalVoice | ( | LocalVoice & | voice | ) |
Removes local voice (outgoing data stream).
voice | Handler of outgoing stream to be removed. |