PyTox wraps libtoxav API with the object pytox.ToxAV, all the toxav API methods are in this class.
ToxAV object
Call a friend with friend_id, with seconds ringing timeout. Returns the index call_index of the call.
call_type can be one of following value:
control_type | description |
---|---|
ToxAV.TypeAudio | audio only call |
ToxAV.TypeVideo | audio and video call |
Cancel outgoing request.
Query if certain capability is supported.
capability can be one of following value:
control_type | description |
---|---|
ToxAV.AudioEncoding | audio encoding |
ToxAV.AudioDecoding | audio decoding |
ToxAV.VideoEncoding | video encoding |
ToxAV.VideoEncoding | video decoding |
Notify peer that we are changing call settings. settings is adictionary of new settings like the one returned by get_peer_csettings
See also
Get current call state
The state returned can be one of following value:
state |
---|
ToxAV.CallNonExistent |
ToxAV.CallInviting |
ToxAV.CallStarting |
ToxAV.CallActive |
ToxAV.CallHold |
ToxAV.CallHanged_up |
Get peer transmission type. It can either be audio or video. peer_num is always 0 for now.
Get friend_number of peer participating in conversation. peer_num is always 0 for now.
Get the Tox object associated with this ToxAV instance.
Hangup active call.
Call this at the end of the transmission.
Receive decoded audio packet. Default implementation does nothing.
on_cancel handler. Default implementation does nothing.
on_end handler. Default implementation does nothing.
on_invite handler. Default implementation does nothing.
on_peer_cs_change handler. Default implementation does nothing.
on_peer_timeout handler. Default implementation does nothing.
on_reject handler. Default implementation does nothing.
on_request_timeout handler. Default implementation does nothing.
on_ringing handler. Default implementation does nothing.
on_self_cs_change handler. Default implementation does nothing.
on_start handler. Default implementation does nothing.
Receive decoded video packet. Default implementation does nothing.
Must be call before any RTP transmission occurs. support_video is either True or False.
Reject incomming call.
Encode and send video packet. data should be a str or buffercontaining singal channel 16 bit signed PCM audio data.
Encode and send video packet. data should be a str or buffercontaining a image in RGB888 format.
Terminate transmission. Note that transmission will be terminated without informing remote peer.