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).
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:
Function Name (and parameters) |
Description |
SFInitEngine (int MinVersion, int MaxVersion, SFENGINE* sfEngine) | Initialize the engine, specifying the supported engine version(s). |
SFCallConnect (IN_ADDR inAddress, SFCALL* sfCall) | Call someone at a specific IP Address. |
SFCallGetOptions (SFCALL* sfCall) | Get current compression/encryption options for specified call. |
SFCallSetOptions (SFCALL* sfCall) | Set compression/encryption options for specified call. |
SFCallTerminate (SFCALL* sfCall) | Terminate (hang up) the specified call. |
SFDirectoryLookup (SFUSER* sfUser) | Look someone up in the Look Who's Listening directory. |
SFDirectoryPublish (SFUSER* sfUser, int bPublish) | Publish/hide local user information in LWL directory. |
SFCloseEngine (SFENGINE* sfEngine) | Close the engine and free allocated resources. |
SFEncodePacket (SFCALL* sfCall, SFPACKET* sfPacket, char* pSamples) | Encrypt and/or compress audio data for transport via Speak Freely. |
SFDecodePacket (SFCALL* sfCall, SFPACKET* sfPacket, char* pSamples) | Decrypt and/or decompress audio data from Speak Freely packet. |
SFShipPacket (SFCALL* sfCall, SFPACKET* sfPacket) | Send the sound to the other party. |
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.
SFENGINE
{
SFCALL
{
SFUSER
{
SFPACKET
{