Lehi Toskin
;simple1-to-1functionwrapper(set-self-name!my-toxmy-name)(set-self-status-message!my-status-message)
Tox uses several enums and many different constants. It is important to be familiar with the enums, especially.
value
value
value
:(ctype-sizeofuint32_t)(ctype-sizeofuint16_t))
value
TOX_MAX_NAME_LENGTH :128
value
value
value
TOX_MAX_MESSAGE_LENGTH :1372
value
value
TOX_HASH_LENGTH :32
value
value
value
Tox uses various enumerations in many of its functions and they are explained below.
value
_TOX-USER-STATUS :'(availableawaybusy)
value
_TOX-MESSAGE-TYPE :'(normalaction)
value
_TOX-PROXY-TYPE :'(nonehttpsocks5)
value
_TOX-ERR-OPTIONS-NEW :'(okmalloc)
value
_TOX-ERR-NEW :'(oknullmallocport-allocproxy-bad-typeproxy-bad-hostproxy-bad-portproxy-not-foundload-encryptedload-bad-format)
'port-alloc is returned when the function was unable to bind to a port. This may mean that all ports have already been bound, e.g. by other Tox instances, or it may mean a permission error.
'proxy-bad-type is returned when the proxy-type variable was invalid.
'proxy-bad-host is returned when the proxy-type variable was valid, but the proxy-host had an invalid format or was NULL.
'proxy-bad-port is returned when the proxy-type was valid, but the proxy-port was invalid.
'proxy-not-found is returned when the proxy host passed could not be resolved.
'load-encrypted is returned when the bytes loaded into the function contained an encrypted save.
'load-bad-format is returned when the data format was invalid. This can happen when loading data that was saved by an older version of Tox, or when the data has been corrupted. When loading from badly formatted data, some data may have been loaded, and the rest is discarded.
value
_TOX-ERR-BOOTSTRAP :'(oknullbad-hostbad-port)
value
_TOX-CONNECTION :'(nonetcpudp)
value
_TOX-ERR-SET-INFO :'(oknulltoo-long)
value
_TOX-ERR-FRIEND-SEND-MESSAGE :'(oknullfriend-not-foundfriend-not-connectedsendqtoo-longempty)
value
_TOX-FILE-KIND :'(dataavatar)
'avatar is used when sending avatar data. Avatars can be sent at any time the client wishes. Generally, a client will send the avatar to a friend when that friend comes online, and to all friends when the avatar changed. A client can save some traffic by remembering which friend received the updated avatar already and only send it if the friend has an out of date avatar. Clients who receive avatar send requests can reject it (by sending TOX_FILE_CONTROL_CANCEL before any other controls), or accept it (by sending TOX_FILE_CONTROL_RESUME). The file_id of length TOX_HASH_LENGTH bytes (same length as TOX_FILE_ID_LENGTH) will contain the hash. A client can compare this hash with a saved hash and send TOX_FILE_CONTROL_CANCEL to terminate the avatar transfer if it matches. When file_size is set to 0 in the transfer request it means that the client has no avatar.
value
_TOX-FILE-CONTROL :'(resumepausecancel)
'pause is sent by clients to pause the file transfer. The initial state of a file transfer is always paused on the receiving side and running on the sending side. If both the sending and receiving side pause the transfer, then both need to send TOX_FILE_CONTROL_RESUME for the transfer to resume.
'cancel is sent by the receiving client to reject a file send request before any other commands are sent. Also sent by either side to terminate a file transfer.
value
_TOX-ERR-FILE-CONTROL :'(okfriend-not-foundfriend-not-connectednot-foundnot-pauseddeniedalready-pausedsendq)
'denied is returned when a 'resume control was sent, but the file transfer was paused by the other party. Only the party that paused the transfar can resume it.
'senq is returned when the packet queue is full.
value
_TOX-ERR-FILE-SEEK :'(okfriend-not-foundfriend-not-connectedtransfer-not-foundseek-deniedinvalid-positionsendq)
'seek-denied is returned when the file was not in a state where it could be seeked.
'invalid-position is returned when the seek position was invalid.
'senq is returned when the packet queue is full.
value
_TOX-ERR-FILE-GET :'(okfriend-not-foundtransfer-not-found)
value
value
_TOX-ERR-FILE-SEND-CHUNK :'(oknullfriend-not-foundfriend-not-connectednot-foundnot-transferringinvalid-lengthsenqwrong-position)
value
_TOX-ERR-FRIEND-CUSTOM-PACKET :'(oknullfriend-not-foundfriend-not-connectedinvalidemptytoo-longsendq)
value
_TOX-ERR-KEY-DERIVATION :'(oknullfailed)
value
'key-derivation-failed is returned when the crypto lib was unable to derive a key from the given passphrase, which is usually a lack of memory issue. The functions accepting keys do not produce this error.
'encryption-failed is returned when the encryption itself failed.
value
value
_TOX-GROUPCHAT-TYPE :'(textav)
value
_TOX-CHAT-CHANGE-PEER :'(adddelname)
'del is for when a peer has left the groupchat.
'name is for when a peer has changed her nickname.
procedure
( _ToxAvCallbackID sym)→(or/c false?integer? )
sym :'Ringing'Start'Cancel'Reject'End'RequestTimeout'PeerTimeout'PeerCSChange'SelfCSChange)
'Ringing is when the peer is ready to accept/reject the call.
'Start is when the call (rtp transmission) has started.
'Cancel is when the side that initiated the call has canceled the invite.
'Reject is when the side that was invited rejected the call.
'End is when the call that was active has ended.
'RequestTimeout is when the request didn’t get a response in time.
'PeerTimeout peer timed out; stop the call.
'PeerCSChange is when the peer changed csettings. Prepare for changed AV.
'SelfCSChange is for csettings change confirmation. Once triggered, the peer is ready to receive changed AV.
procedure
( _ToxAvCallType sym)→(or/c false?integer? )
procedure
( _ToxAvCallState sym)→(or/c false?integer? )
'CallInviting is for when we’re sending a call invite.
'CallStarting is for when we’re getting a call invite.
procedure
( _ToxAvError sym)→(or/c false?integer? )
sym :
'InvalidState means we are trying to perform a call action while in an invalid state.
'AlreadyInCallWithPeer means we are trying to call peer when already in a call with peer.
'ReachedCallLimit means we cannot handle more calls.
'InitializingCodecs means we failed to create a CSSession.
'SplittingVideoPayload means there was an error splitting the video payload
'EncodingVideo means vpx_codec_encode failed.
'EncodingAudio means opus_encode failed.
'SendingPayload means sending lossy packet failed.
'CreatingRtpSessions means one of the rtp sessions failed to initialize.
'NoRtpSession means we tried to perform an rtp action on an invalid session.
'InvalidCodecState means the codec state was not initialized.
'PacketTooLarge means the buffer exceeds size while encoding.
Those not listed above are self-explanatory.
procedure
( _ToxAvCapabilities sym)→(or/c false?integer? )
'AudioDecoding is equivalent to 1 << 1 or (expt 21)
'VideoEncoding is equivalent to 1 << 2 or (expt 22)
'VideoDecoding is equivalent to 1 << 3 or (expt 23)
The functions in libtoxcore-racket/functions are the base wrappers for the functions found in libtoxcore.
procedure
( friendlist-lengthtox)→integer?
tox:_Tox-pointer
You should use this to determine how much memory to allocate for copy_friendlist.
procedure
( friend-exists? toxfriendnumber)→boolean?
tox:_Tox-pointerfriendnumber:integer?
return #t if friend exists.
return #f if friend doesn’t exist.
Return an address to give to others. (Must be transformed into hex format for ordinary usage).
return public key if success.
return #f if failure.
procedure
tox:_Tox-pointerfriendnumber:integer?
return 1 if friend is connected to us (Online).
return 0 if friend is not connected to us (Offline).
return -1 on failure.
Returns the friend list (in bytes).
If the list-size was too small, the contents of the return value will be truncated to list-size.
tox:_Tox-pointerpublic-key:bytes?
return #f if no such friend
returns #t if friend is typing.
returns #f if friend is not typing.
tox:_Tox-pointerfriendnumber:integer?
returns #f on error.
return #f if failure.
tox:_Tox-pointerfriendnumber:integer?
returns #f on failure.
procedure
( get-num-online-friendstox)→integer?
tox:_Tox-pointer
return 0 on error.
return #f on failure.
return #f on failure.
Values unknown to your application should be represented as TOX_USERSTATUS_NONE.
If friendnumber is invalid, this shall return TOX_USERSTATUS_INVALID.
procedure
( get-self-user-statustox)→integer?
tox:_Tox-pointer
tox:_Tox-pointerfriendnumber:integer?
The self variant will return our own status message.
returns the status message (in bytes) of the friend on success.
return #f on failure.
returns #f on failure.
name must be a string of maximum TOX_MAX_NAME_LENGTH length.
length must be at least 1 byte.
length is the length of name with the NULL terminator.
return #t if success.
return #f if failure.
max length of the status is TOX_MAX_STATUSMESSAGE_LENGTH.
returns #t on success.
returns #f on failure.
userstatus must be one of TOX_USERSTATUS values.
returns #t on success.
returns #f on failure.
You are responsible for turning it on or off.
returns #t on success.
returns #f on failure.
tox:_Tox-pointergroupnumber:integer?
return #f on failure
Returns a list whose car is the lengths if the names in its cdr on success.
return #f on failure.
return #f on failure
procedure
( count-chatlist tox)→integer?
tox:_Tox-pointer
You should use this to determine how much memory to allocate for copy_chatlist.
If list-size was too small, the contents of the return value will be truncated to list-size.
return 0 on failure.
procedure
( get-nospamtox)→integer?
tox:_Tox-pointer
procedure
( get-keystoxsecret-keypublic-key)→void?
tox:_Tox-pointersecret-key:bytes?public-key:bytes?
public-key and secret-key must be 32 bytes long.
if the pointer is NULL, no data will be copied to it.
procedure
( group-set-title!toxgroupnumbertitle)→boolean?
tox:_Tox-pointergroupnumber:integer?title:bytes?
return #t on success
return #f on failure.
tox:_Tox-pointergroupnumber:integer?
Return title (in bytes) on success.
return #f on failure.
address can be a hostname or an IP address (IPv4 or IPv6)
returns #t if the address was converted into an IP address
returns #f otherwise
procedure
( tox-connected?tox)→boolean?
tox:_Tox-pointer
return #t if we are.
procedure
( send-messagetoxfriendnumbermessage)→integer?
tox:_Tox-pointerfriendnumber:integer?message:bytes?
return the message id if packet was successfully put into the send queue.
return 0 if it was not.
maximum length of messages is TOX_MAX_MESSAGE_LENGTH , your client must split larger messages or else sending them will not work.
You will want to retain the return value, it will be passed to your read_receipt callback if one is received.
procedure
( send-actiontoxfriendnumberaction)→integer?
tox:_Tox-pointerfriendnumber:integer?action:bytes?
return the message id if packet was successfully put into the send queue.
return 0 if it was not.
You will want to retain the return value, it will be passed to your read_receipt callback if one is received.
procedure
( group-message-send toxgroupnumbermessage)→boolean?
tox:_Tox-pointergroupnumber:integer?message:bytes?
return #t on success.
return #f on failure.
procedure
( group-action-send toxgroupnumberaction)→boolean?
tox:_Tox-pointergroupnumber:integer?action:bytes?
return #t on success.
return #f on failure.
returns #t if it does
returns #f if it does not.
struct
udp-disabled?proxy-typeproxy-addressproxy-port)ipv6-enabled?:boolean?udp-disabled?:boolean?proxy-type:integer?proxy-address:string?proxy-port:integer?
Set udp-disabled? to #t to disable udp support. (default: #f) This will force Tox to use TCP only which may slow things down. Disabling udp support is necessary when using anonymous proxies or Tor.
proxy-type is a value from TOX_PROXY_TYPE enumerator.
proxy-address is the IP or domain of the proxy.
proxy-port is the port of the proxy in host byte order.
procedure
( tox-new opts)→_Tox-pointer
opts:_Tox-Options-pointer
Options are some options that can be passed to the Tox instance (see above struct).
If options is null , tox-new will use default settings.
Initializes a tox structure
return allocated instance of tox on success.
return 0 if there are problems.
Free all datastructures.
procedure
( tox-dotox)→void?
tox:_Tox-pointer
procedure
( tox-do-intervaltox)→integer?
tox:_Tox-pointer
procedure
( tox-sizetox)→integer?
tox:_Tox-pointer
procedure
( tox-savetox)→bytes?
tox:_Tox-pointer
returns #t on success
returns #f on failure
Set the message that will be sent along with friend request. Must not be longer than TOX_MAX_FRIENDREQUEST_LENGTH length in bytes.
address is the address of the friend (returned by getaddress of the friend you wish to add) it must be TOX_ADDRESS_SIZE bytes.
message is the friend request message and message-length is the length of the message being sent.
return the friend number if success.
return TOX_FA_TOOLONG if message length is too long.
return TOX_FAERR_NOMESSAGE if no message (message length must be >= 1 byte).
return TOX_FAERR_OWNKEY if our own key.
return TOX_FAERR_ALREADYSENT if friend request already sent or already a friend.
return TOX_FAERR_UNKNOWN for unknown error.
return TOX_FAERR_BADCHECKSUM if bad checksum in address.
return TOX_FAERR_SETNEWNOSPAM if the friend was already there but the nospam was different. (the nospam for that friend was set to a different one).
return TOX_FAERR_NOMEM if increasing the friend list size fails.
tox:_Tox-pointerpublic-key:bytes?
return the friend number on success.
return #f on failure.
public-key is the bytes form of the Tox ID; e.g. (hex-string->bytesstr).
return #t if success.
return #f if failure.
return group number on success.
return #f on failure.
procedure
( del-groupchat! toxgroupnumber)→boolean?
tox:_Tox-pointergroupnumber:integer?
return #t on success.
return #f on failure.
procedure
( invite-friend toxfriendnumbergroupnumber)→boolean?
tox:_Tox-pointerfriendnumber:integer?groupnumber:integer?
return #t on success.
return #f on failure.
procedure
( join-groupchat toxfriendnumberdatalen)
tox:_Tox-pointerfriendnumber:integer?data:bytes?len:integer?
return groupnumber on success.
return #f on failure.
procedure
friendnumberfilesizefilenametox:_Tox-pointerfriendnumber:integer?filesize:integer?filename:string?
Maximum filename length is 255 bytes.
return file number on success
return #f on failure
procedure
friendnumberreceiving?filenumbermessage-iddatatox:_Tox-pointerfriendnumber:integer?receiving?:boolean?filenumber:integer?message-id:integer?data:bytes?len:integer?
return #t on success
return #f on failure
procedure
friendnumberfilenumberdatatox:_Tox-pointerfriendnumber:integer?filenumber:integer?data:bytes?len:integer?
return #t on success
return #f on failure
If this function returns #f, you must tox-do, sleep tox-do-interval miliseconds, then attempt to send the data again.
tox:_Tox-pointerfriendnumber:integer?
return size on success
return #f on failure (currently will never return #f)
return number of bytes remaining to be sent/received on success
return #f on failure
This should be made before connecting, so we will not announce that the user have no avatar before setting and announcing a new one, forcing the peers to re-download it.
Notice that the library treats the image as raw data and does not interpret it by any way.
Arguments:
format - Avatar image format or NONE for user with no avatar (see TOX_AVATAR_FORMAT);
data - bytes containing the avatar data (may be NULL it the format is NONE);
len - length of image data. Must be <= TOX_AVATAR_MAX_DATA_LENGTH.
returns #t on success
returns #f on failure.
procedure
( unset-avatar!tox)→integer?
tox:_Tox-pointer
returns 0 on success (currently always returns 0).
returns a list containing the image hash and the image data.
returns #f on failure.
This function may be used by clients for any purpose, but is provided primarily for validating cached avatars.
This function is a wrapper to internal message-digest functions.
returns hash (in bytes) on success
returns #f on failure.
Asks a friend to provide their avatar information (image format and hash). The friend may or may not answer this request and, if answered, the information will be provided through the callback ’avatar_info’.
returns #t on success
returns #f on failure.
Sends our avatar format and hash to a friend; he/she can use this information to validate an avatar from the cache and may (or not) reply with an avatar data request.
Notice: it is NOT necessary to send this notification after changing the avatar or connecting. The library already does this.
returns #t on success
returns #f on failure.
Ask a friend to send their avatar data. The friend may or may not answer this request and, if answered, the information will be provided in callback ’avatar_data’.
returns #t on sucess
returns #f on failure.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxpublic-keydatalenuserdata)
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumbermessagelenuserdata).
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberactionlenuserdata)
procedure
( callback-name-changetoxanonproc[userdata])→void?
tox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumbernewnamelenuserdata)
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendstatusnewstatuslenuserdata)
procedure
( callback-user-statustoxanonproc[userdata])→void?
tox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberTOX_USERSTATUSuserdata)
procedure
anonproctox:_Tox-pointeranonproc:prodecure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumbertyping?userdata) where typing? is a boolean value.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberstatususerdata).
If you are keeping a record of returns from m_sendmessage; receipt might be one of those values, meaning the message has been received on the other side.
Since core doesn’t track ids for you, receipt may not correspond to any message. In that case, you should discard it.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberstatususerdata) where status is a string.
Status:
0 – friend went offline after being previously online
1 – friend went online
NOTE: This callback is not called when adding friends, thus the "after being previously online" part. it’s assumed that when adding friends, their connection status is offline.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberfilenumberfilesizefilenamefilename-lengthuserdata) where filename is a string.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumbersending?filenumbercontrol-typedatalenuserdata) where control-type is a TOX_FILECONTROL enum value.
procedure
( callback-file-datatoxanonproc[userdata?])→void?
tox:_Tox-pointeranonproc:procedure?userdata?:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumberfilenumberdatalenuserdata)
data is a byte string of length len.
WARNING: Groupchats will be rewritten so these might change
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxfriendnumbertypedatalenuserdata)
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxgroupnumberpeernumbermessagelenuserdata)
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxgroupnumberpeernumberactionlenuserdata)
procedure
( callback-group-title toxanonproc[userdata])→void?
tox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
anonproc is in the form (anonproctoxgroupnumberpeernumbertitlelenuserdata) where title is a byte string.
procedure
anonproctox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
It gets called every time the name list changes (new peer/name, deleted peer)
anonproc is in the form (anonproctoxgroupnumberpeernumberchangeuserdata)
change is a TOX_CHAT_CHANGE enum value.
Avatars must be in PNG format.
procedure
( callback-avatar-infotoxanonproc[userdata])→void?
tox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
This callback will be called when avatar information are received from friends. These events can arrive at anytime, but are usually received upon connection and in reply of avatar information requests.
anonproc is in the form (anonproctoxfriendnumberformat hash userdata) where ’format’ is the avatar image format (see TOX_AVATAR_FORMAT) and ’hash’ is the hash of the avatar data (in a byte-string) for caching purposes and it is exactly TOX_HASH_LENGTH long. If the image format is NONE, the hash is zeroed.
procedure
( callback-avatar-datatoxanonproc[userdata])→void?
tox:_Tox-pointeranonproc:procedure?userdata:cpointer?=#f
This callback will be called when the complete avatar data was correctly received from a friend. This only happens in reply of an avatar data request (see request-avatar-data);
anonproc is in the form (anonproctoxfriendnumberimg-formatimg-hashdata-ptrdatalenuserdata) where img-format is the avatar image format (see TOX_AVATAR_FORMAT); img-hash is the locally-calculated cryptographic hash of the avatar data (in a byte-string) and it is exactly TOX_HASH_LENGTH long; data-ptr is the avatar image data (as a pointer) and datalen is the length of such data.
If format is 'NONE, data-ptr is #f, datalen is zero, and the hash is zeroed. The hash is always validated locally with the function tox-hash and ensured to match the image data, so this value can be safely used to compare with cached avatars.
WARNING: users MUST treat all avatar image data received from another peer as untrusted and potentially malicious. The library only ensures that the data which arrived is the same the other user sent, and does not interpret or validate any image data.
The functions in libtoxcore-racket/av pertain to Audio/Video interaction.
struct
video_bitratevideo_widthvideo_heightaudio_bitrateaudio_frame_durationaudio_sample_rateaudio_channels)#:extra-constructor-namemake-_ToxAvCSettings)call_type:integer?video_bitrate:integer?video_width:integer?video_height:integer?audio_bitrate:integer?audio_frame_duration:integer?audio_sample_rate:integer?audio_channels:integer?
video_bitrate is in kbit/s
video_width is in px
video_height is in px
audio_bitrate is in bits/s
audio_frame_duration is in ms
audio_sample_rate is in Hz
procedure
( ToxAVCallback agentcall-indexarg)→void?
agent:cpointer?call-index:integer?arg:cpointer?
procedure
call-indexpcmsizeagent:cpointer?call-index:integer?pcm:bytes?size:integer?data:cpointer?
return _ToxAv-pointer
return NULL On error.
return void
procedure
( toxav-do-interval av)→integer?
av:_ToxAv-pointer
procedure
( callback-callstate avcallbackid[userdata])→void?
av:_ToxAv-pointercallback:procedure?id:integer?userdata:cpointer?=#f
callback is the ToxAvCallback procedure.
id is one of the ToxAvCallbackID values
return void
procedure
( callback-audio-recv avcallback[userdata])→void?
av:_ToxAv-pointercallback:procedure?userdata:cpointer?=#f
callback is in the ToxAvAudioCallback procedure.
return void
procedure
( callback-video-recv avcallback)→void?
av:Tox-Av-pointercallback:procedure?
callback is in the ToxAvAudioCallback procedure.
return void
return #t on success.
return _ToxAvError on error.
av:_ToxAv-pointercall-index:integer?csettings:cpointer?
return #t on success.
return _ToxAvError On error.
Optional reason. Set NULL if none.
return #t on success.
return _ToxAvError on error.
procedure
( av-change-settings avcall-indexcsettings)→integer?
av:_ToxAv-pointercall-index:integer?csettings:cpointer?
return 0 on success
return _ToxAvError
Optional reason.
return 0 on success.
return _ToxAvError on error.
procedure
( av-stop-call avcall-index)→integer?
av:_ToxAv-pointercall-index:integer?
return 0 on success.
return _ToxAvError on error.
Also, it must be called when call is started
procedure
( kill-transmission avcall-index)→integer?
av:_ToxAv-pointercall-index:integer?
return 0 on success.
return _ToxAvError on error.
procedure
call-indexdestdest-maxav:_ToxAv-pointercall-index:integer?dest:cpointer?dest-max:integer?input:bytes?
procedure
( send-video avcall-indexframeframe-size)→integer?
av:_ToxAv-pointercall-index:integer?frame:cpointer?frame-size:integer?
return 0 on success.
return _ToxAvError on error.
procedure
call-indexdestdest-maxframeav:_ToxAv-pointercall-index:integer?dest:cpointer?dest-max:integer?frame:cpointer?frame-size:integer?
return >0 on success.
return _ToxAvError on error.
procedure
( send-audio avcall-indexframeframe-size)→integer?
av:_ToxAv-pointercall-index:inteder?frame:bytes?frame-size:integer?
frame is the frame (raw 16 bit signed pcm with AUDIO_CHANNELS channels audio.)
frame-size is its size in number of frames/samples (one frame/sample is 16 bits or 2 bytes). frame-size should be AUDIO_FRAME_SIZE.
return 0 on success.
return _ToxAvError on error.
procedure
( get-peer-csettings avcall-indexpeer)→list?
av:_ToxAv-pointercall-index:integer?peer:integer?
return a list containing _ToxAvCallType and a csettings cpointer on success.
return a list containing _ToxAvError on error.
procedure
( get-peer-id avcall-indexpeer)→integer?
av:_ToxAv-pointercall-index:integer?peer:integer?
return _ToxAvError when there is no peer id
procedure
( get-call-state avcall-index)→integer?
av:_ToxAv-pointercall-index:integer?
returns integer from _ToxAvCallState .
capability is on of ToxAvCapabilities.
procedure
( av-get-tox av)→_Tox-pointer
av:_ToxAv-pointer
procedure
( get-active-calls av)→integer?
av:_ToxAv-pointer
procedure
audio-callbacktox:_Tox-pointeraudio-callback:procedure?userdata:cpointer?=#f
audio-callback is in the form (audio-callbacktoxgroupnumberpeernumberpcmsampleschannelssample-rateuserdata) where pcm is a byte string of the size (* sampleschannels(ctype-sizeofint16_t)).
return groupnumber on success.
return -1 on failure.
procedure
friendnumberdatadata-lenaudio-callbacktox:_Tox-pointerfriendnumber:integer?data:cpointer?data-len:integer?audio-callback:procedure?userdata:cpointer?=#f
audio-callback is in the form (audio-callbacktoxgroupnumberpeernumberpcmsampleschannelssample-rateuserdata) where pcm is of size (* sampleschannels).
return groupnumber on success.
return -1 on failure.
procedure
groupnumberpcmsampleschannelstox:_Tox-pointergroupnumber:integer?pcm:bytes?samples:integer?channels:integer?sample-rate:integer?
Note that pcm is a byte string of the size (* sampleschannels(ctype-sizeofint16_t)).
Valid number of samples are ((sample rate) * (audio length (Valid ones are: 2.5, 5, 10, 20, 40 or 60 ms)) / 1000)
Valid number of channels are 1 or 2.
Valid sample rates are 8000, 12000, 16000, 24000, or 48000.
Recommended values are: samples = 960, channels = 1, sample_rate = 48000
return 0 on success
return -1 on failure.
Copyright (C) 2014 Lehi Toskin.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License and GNU Lesser General Public License for more details.
Copyright (C) 2014 Lehi Toskin.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
_TOX-CHAT-CHANGE-PEER
_TOX-CONNECTION
_TOX-ERR-BOOTSTRAP
_TOX-ERR-DECRYPTION
_TOX-ERR-ENCRYPTION
_TOX-ERR-FILE-CONTROL
_TOX-ERR-FILE-GET
_TOX-ERR-FILE-SEEK
_TOX-ERR-FILE-SEND
_TOX-ERR-FILE-SEND-CHUNK
_TOX-ERR-FRIEND-CUSTOM-PACKET
_TOX-ERR-FRIEND-SEND-MESSAGE
_TOX-ERR-KEY-DERIVATION
_TOX-ERR-NEW
_TOX-ERR-OPTIONS-NEW
_TOX-ERR-SET-INFO
_TOX-FILE-CONTROL
_TOX-FILE-KIND
_TOX-GROUPCHAT-TYPE
_TOX-MESSAGE-TYPE
_TOX-PROXY-TYPE
_TOX-USER-STATUS
_ToxAvCallbackID
_ToxAvCallState
_ToxAvCallType
_ToxAvCapabilities
_ToxAvCSettings (struct)
_ToxAvCSettings-audio_bitrate
_ToxAvCSettings-audio_channels
_ToxAvCSettings-audio_frame_duration
_ToxAvCSettings-audio_sample_rate
_ToxAvCSettings-call_type
_ToxAvCSettings-video_bitrate
_ToxAvCSettings-video_height
_ToxAvCSettings-video_width
_ToxAvCSettings?
_ToxAvError
add-av-groupchat
add-friend
add-friend-norequest
add-groupchat
Audio/Video
av-answer
av-call
av-cancel
av-change-settings
av-get-tox
av-hangup
av-kill!
av-new
av-reject
av-stop-call
Avatar Callbacks
Avatar Handling and Manipulation
bootstrap-from-address
callback-audio-recv
callback-avatar-data
callback-avatar-info
callback-callstate
callback-connection-status
callback-file-control
callback-file-data
callback-file-send-request
callback-friend-action
callback-friend-message
callback-friend-request
callback-group-action
callback-group-invite
callback-group-message
callback-group-namelist-change
callback-group-title
callback-name-change
callback-read-receipt
callback-status-message
callback-typing-change
callback-user-status
callback-video-recv
Callbacks
capability-supported?
Constants
Constants and Enums
count-chatlist
del-friend!
del-groupchat!
Documentation License
Enums
Examples
File Sending Callbacks
file-data-remaining
file-data-size
Filesending Functions
Friend and Group Manipulation
friend-exists?
friendlist-length
Functions
General Callbacks
get-active-calls
get-call-state
get-chatlist
get-client-id
get-friend-connection-status
get-friend-number
get-friendlist
get-group-names
get-group-number-peers
get-group-peer-pubkey
get-group-peername
get-keys
get-last-online
get-name
get-name-size
get-nospam
get-num-online-friends
get-peer-csettings
get-peer-id
get-self-address
get-self-avatar
get-self-name
get-self-name-size
get-self-status-message
get-self-status-message-size
get-self-user-status
get-status-message
get-status-message-size
get-user-status
Getters and Setters
group-action-send
group-get-title
group-message-send
group-peernumber-is-ours?
group-send-audio
group-set-title!
Groupchat Callbacks
Interact with Tox
invite-friend
is-typing?
join-av-groupchat
join-groupchat
kill-transmission
Library License
libtoxcore-racket
libtoxcore-racket
libtoxcore-racket/av
libtoxcore-racket/functions
Licensing
make-_ToxAvCSettings
make-Tox-Options
new-file-sender
prepare-audio-frame
prepare-transmission
prepare-video-frame
Procedures
request-avatar-data
request-avatar-info
Saving and Loading Functions
send-action
send-audio
send-avatar-info
send-file-control
send-file-data
send-message
send-video
set-avatar!
set-name
set-nospam!
set-status-message!
set-user-is-typing!
set-user-status!
struct:_ToxAvCSettings
struct:Tox-Options
Structs
tox-connected?
tox-do
tox-do-interval
tox-hash
tox-kill!
tox-load
tox-new
Tox-Options (struct)
Tox-Options-ipv6-enabled?
Tox-Options-proxy-address
Tox-Options-proxy-port
Tox-Options-proxy-type
Tox-Options-udp-disabled?
Tox-Options?
tox-save
tox-size
TOX_ADDRESS_SIZE
TOX_FILE_ID_LENGTH
TOX_HASH_LENGTH
TOX_MAX_CUSTOM_PACKET_SIZE
TOX_MAX_FILENAME_LENGTH
TOX_MAX_FRIEND_REQUEST_LENGTH
TOX_MAX_MESSAGE_LENGTH
TOX_MAX_NAME_LENGTH
TOX_MAX_STATUS_MESSAGE_LENGTH
TOX_PUBLIC_KEY_SIZE
TOX_SECRET_KEY_SIZE
toxav-do
toxav-do-interval
ToxAvAudioCallback
ToxAVCallback
ToxAvVideoCallback
TOXDNS_MAX_RECOMMENDED_NAME_LENGTH
unset-avatar!