public class MaryServer extends Object implements Runnable
MaryProperties.socketPort()
. For each new client, create a new RequestHandler
thread.
Clients are expected to follow the following protocol:
A client opens two socket connections to the server. The first, infoSocket
, serves for passing meta-information,
such as the requested input and output types or warnings. The second, dataSocket
, serves for passing the actual
input and output data. The server expects the communication as follows.
infoSocket
, optionally sends one line "MARY VERSION" to obtain three lines of version
information, and then sends one line "MARY IN=INPUTTYPE OUT=OUTPUTTYPE [AUDIO=AUDIOTYPE]", where INPUTTYPE and OUTPUTTYPE can
have a number of different values, depending on the configuration with which the server was started. For an English system,
these values include:
The optional AUDIO=AUDIOTYPE specifies the type of audio file to be sent for audio output. Possible values are:
The optional VOICE=VOICENAME specifies the default voice with which the text is to be spoken. As for the data types, possible values depend on the configuration of the server. The list can be retrieved by sending the server a line "MARY LIST VOICES", which will reply with lines such as "de7 de female", "kevin16 en male" or "us2 en male".
The optional EFFECTS=EFFECTSWITHPARAMETERS specifies the audio effects to be applied as a post-processing step along with their parameters. EFFECTSWITHPARAMETERS is a String of the form "Effect1Name(Effect1Parameter1=Effect1Value1; Effect1Parameter2=Effect1Value2), Effect2Name(Effect2Parameter1=Effect2Value1)" For example, "Robot(amount=100),Whisper(amount=50)" will convert the output into a whispered robotic voice with the specified amounts.
Example: The line
MARY IN=TEXT OUT=AUDIO AUDIO=WAVE VOICE=kevin16 EFFECTSwill process normal ASCII text, and send back a WAV audio file synthesised with the voice "kevin16".
infoSocket
. This integer is a unique identification number for this request.dataSocket
. As a first line
on this dataSocket
, it sends the single integer it had just received via the infoSocket
.dataSocket
.infoSocket
.dataSocket
.RequestHandler
Modifier and Type | Class and Description |
---|---|
class |
MaryServer.ClientHandler |
Constructor and Description |
---|
MaryServer() |
Copyright © 2000–2016 DFKI GmbH. All rights reserved.