Speak Freely Application Programming Interface: Draft 0.1 - 06/03/1999 by Brian C. Wiles
Speak Freely Application Programming Interface: Draft 0.1 - 06/03/1999 by Brian C. Wiles
Speak Freely
Application Programming Interface
Draft 0.1 - 06/03/1999
by Brian C. Wiles
Contents
1. Introduction
2. Function Summary
3. Engine Initialization
4. Call Initiation
5. Call Options
6. Call Termination
7. Directory Functions
8. Misc. Functions
9. Structures
10. Failure Codes
11. Implementation Recommendations
12. Notes
Introduction
This specification defines the developer API for the Speak Freely Engine. To make things easier,
the Engine version numbers will remain consistant with the version numbers of the Speak Freely
interface release that uses that Engine. Since the Engine was separated in version 8.0, the first
Engine version is 8.0.
The purpose of this specification is to allow developers of other applications to add Internet
telephony to their existing products, or to develop their own Internet telephone, without having to
know the details of how Voice Over IP (VoIP) works. For example, a game developer can add
realtime virtual radio communications to their latest air combat simulator. The possibilities are
endless, which is why it makes more sense to developers to concentrate their efforts on
developing their unique product rather than having to reinvent the wheel (or, in this case, the
engine).
This specification also defines the required behavior of any Speak Freely-compliant engine. All
of the described functions MUST be implemented EXACTLY as described. Generally, however,
it is recommended that developers NOT create their own engine since the full source code of the
official Speak Freely engine is freely available with source code.
Developers are encouraged to contribute their fixes, enhancements, and new platform ports to the
Speak Freely Developers. This will ensure new engines remain stable and makes the software
available to more people on different platforms.
Throughout this specification, the structures and function behavior has been designed to preserve
Speak Freely's compatibility with older versions. Not all structure members should be modified
by the calling application since the engine uses them internally to keep call states consistent and
separate between different sessions. This also allows the engine to remain thread-safe for
multithreaded applications.
Wherever possible, developers should use the Speak Freely engine to communicate using the
chosen protocol, such as H.323 or RTP, and to record and playback audio using the audio
hardware. The encoding and decoding functions are provided only as a method for the
application to further manipulate the data for purposes such as recording to a file or speech
processing (i.e. speech recognition or text-to-speech).
Function Summary
There are several functions for carrying out different tasks via the Engine. Each function will
return FALSE (0) if successful, or a specific failure code if there was a failure. Failure codes are
listed in a later section.
The following is a brief summary and description of all of the API functions covered under this
specification. Notice that all of the functions contain the prefix "SF" to reduce the chances of a
conflict in a parent application:
SFInitEngine (int MinVersion, int MaxVersion, Initialize the engine, specifying the
SFENGINE* sfEngine) supported engine version(s).
SFCallConnect (IN_ADDR inAddress, SFCALL*
Call someone at a specific IP Address.
sfCall)
Get current compression/encryption
SFCallGetOptions (SFCALL* sfCall)
options for specified call.
Engine Initialization
Call Initiation
Call Options
Call Termination
Directory Functions
Callback Functions
int AcceptConnection (SFCALL* sfCall)
This function should evaluate the incoming call data via the sfCall structure
and return FALSE (0) if the connection should be rejected, or TRUE (-1) if
the connection should be accepted.
Misc. Functions
Structures
The structures the engine uses are as follows:
SFENGINE
{
int iVersionMajor; // The major API version (e.g. the '8' in version 8.0)
int iVersionMinor; // The minor API version (e.g. the '0' in version 8.0)
char szVendor[100]; // The name of the author/vendor of this engine (e.g. "Speak Freely
Developers")
char szName[100]; // The name of the engine (e.g. "Speak Freely")
char szEngineVersion[100]; // This engine implementation's version number (vendor-
specific string, may be different than API version)
int* pfnAcceptConnection; // This function is called when a connection arrives. This
can be NULL if every connection should be accepted.
}
SFCALL
{
SFUSER
{
SFPACKET
{
Failure Codes
Implementation Recommendations
Notes