Node:SSIP, Next:, Previous:Definitions, Up:Internal structure



SSIP

Shared library implementimg public API like spd_sayf(int, int, char*, ...) communicates with Speech Deamon through SSIP, Speech Synthesis Internet Protocol.

Here is a description of it's commands and what they do.

Data flow and speech control

Note that SSIP is still going to change and shouldn't be used directly!

@data on SSIP Command
As Speech Deamon receives this command, it becomes listening for incomming data. It adds incomming data to it's buffer until @data off comes. If client sends more data than Speech Deamon can handle, the session is interrupted, because there is no reasonable way how to handle this error. The client is responsible for sending only reasonable amount of data at once. Note that there is a very good reason to put an upper limit on the number of bytes in one message, it forces developers to structure their output more and therefore history and other Speech Deamon functions become a lot simpler for users.

@data off SSIP Command
The only command that puts end to a data flow. It is allways interpreted as command, so you should be sure to never send this command inside the data to Speech Deamon and expecting it will say it.

@stop [uid|"all"] SSIP Command
Immediately stop speaking from this client and throw away all messages.

If it has no parameter, it's related only to that client.

If there is a positive integer number uid as parameter, it's related to some other client with unique id uid.

If the parameter is the string all, it stops all clients whatsoever and throws away all messages whatsoever.

@pause [uid] SSIP Command
Immediately stop speaking and pause all messages.

If it has no parameter, it's related only to that client.

If there is a positive integer number uid as parameter, it's related to some other client with unique id uid.

@resume [uid] SSIP Command
Start speaking again and say all unpaused messages. (Note that messages level 3 are never said after pause).

If it has no parameter, it's related only to that client.

If there is a positive integer number uid as parameter, it's related to some other client with unique id uid.

Settings

@set client_name str SSIP Command
Set the name of this client to str. String parameter str must be in the format client_name:subclient_name.

For example if the client is lynx and it creates connection for it's command line, the command would be something like this:

@set client_name lynx:cmd_line

@set language str SSIP Command
Set recommended language for this client to str. str str must be a valid LANG language code.

For example, if we want to set the prefered language to Czech, we can send:

@set language cs_CZ

@set priority num SSIP Command
Set the priority for this client to num. It must be either 1, 2 or 3. 1 is the highest, 3 the lowest.

History

@history get client_list SSIP Command
Retrieves a list of know client names, its unique ids and if they are gone or alive in the form:

OK CLIENTS:\ uid client_name:subclient_name active

The reply can look for example like this:

OK CLIENTS:
1 spd_center:main 1\
2 spd_center:status 1\
3 lynx:main 0\
4 lynx:text_buffer 0\
5 lynx:cmd_line 0\

@history get client_messges client_uid from num SSIP Command
Retrieves num messages from the buffer of specified client (client_uid), starting from the number in parameter from, in the follwing form:

OK MESSAGES:\ uid client_name:subclient_name

Warning: This will be subject to future changes!

@history get last SSIP Command
Get the uid of last received message. Useful if the user wants to repeat something he didn't hear.

The reply is in the form: OK LAST MESSAGE:\ uid client_name:subclient_name

@history sort ... SSIP Command
Sorts the history buffer of messages.

Well, this is not implemented yet. I'm sorry...

@history cursor set uid ["first","last","pos" position] SSIP Command

Sets the position of cursor in the history to some particular place. Note that the buffer can be sorted, see @history sort.

If the parameter is first or last, Speech Deamon sets the position to the first or to the last message of client uid respectively.

It the parameter is pos, then an aditional integer parameter position must be specified. Speech Deamon then sets the postion of cursor to the message number pos of client uid.

@history cursor ["next"|"prev"] SSIP Command
Move the cursor one position forward or backward between the messages of currently specified client.

@history cursor get SSIP Command
Get the unique id number of the message the cursor is pointing on.

The reply is in the form: OK MESSAGE:\ uid

@history say ID str SSIP Command
Send message ID to Speech Deamon core to say it aloud.

@history say TEXT str SSIP Command
Say text str without including it in history. Useful for history clients. Not implemented yet...

Return error values

... are going to change soon.