SpeechDispatcherConnection class final
the main object that is used to control and send messages to Speech Dispatcher
This class is used to create a new connection to Speech Dispatcher.
When you create an instance of this class, a connection to Speech Dispatcher is opened. When the instance is garbage collected, the connection is automatically closed.
See below for a list of methods that can be used to control the connection, send messages to Speech Dispatcher and get information about the current state of the connection etc.
- Implemented types
Constructors
- SpeechDispatcherConnection(String clientName, String connectionName, String userName)
- Opens a new connection to Speech Dispatcher
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- language → String
-
The current language in use for synthesis.
no setter
- outputModule → String
-
The current output module in use for synthesis.
no setter
-
outputModules
→ List<
String> -
A list of identification names for all output modules.
no setter
- pitch → int
-
The voice pitch. Between -100 and 100.
no setter
- rate → int
-
The voice speaking rate. Between -100 and 100.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
voices
→ List<
String> -
A list of Strings objects representing all available voices for the current output module.
no setter
- volume → int
-
The volume of the voice and sounds produced by Speech Dispatcher’s output modules. The range is from -100 to 100.
no setter
Methods
-
cancel(
) → void - Stops the currently spoken message from this connection (if there is any) and discards all the queued messages from this connection.
-
cancelAll(
) → void - The same as cancel, but it cancels all the messages from all the connections.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void - Pauses all messages received from the given connection. No messages except for ones with MessagePriority.notification and MessagePriority.progress are thrown away, they are all waiting in a separate queue for resume(). Upon resume(), the message that was being said at the moment pause() was received will be continued from the place where it was paused. returns immediately. However, that doesn’t mean that the speech output will stop immediately. Instead, it can continue speaking the message for a while until a place where the position in the text can be determined exactly is reached. This is necessary to be able to provide ‘resume’ without gaps and overlapping. When pause is on for the given client, all newly received messages are also queued and waiting for resume().
-
pauseAll(
) → void - The same as pause, but it pauses every message, regardless of the connection it came from.
-
resume(
) → void - Resumes all paused messages from this connection. The rest of the message that was being said at the moment pause was received will be said and all the other messages are queued for synthesis again.
-
resumeAll(
) → void - The same as spd_resume(), but it resumes every paused message, without distinguishing where it came from.
-
say(
String text, {MessagePriority priority = MessagePriority.message}) → int -
Sends a message to Speech Dispatcher. If this message isn't blocked by some message of higher priority and
thisconnection isn't paused, it will be synthesized directly on one of the output devices. Otherwise, the message will be discarded or delayed according to its priority. -
sayCharacter(
String character, {MessagePriority priority = MessagePriority.message}) → int - Says a single character according to user settings for characters.
-
sayKey(
String key, {MessagePriority priority = MessagePriority.message}) → int - Says a key according to user settings for keys.
-
setDataMode(
DataMode mode) → bool - Set Speech Dispatcher data mode for this connection. See DataMode for more information.
-
setLanguage(
String language) → bool - Sets the language that should be used for synthesis.
-
setOutputModule(
String outputModule) → bool - Sets the output module that should be used for synthesis.
-
setPitch(
int value) → bool - Set voice pitch. The range is from -100 to 100.
-
setPitchRange(
int value) → bool - Set voice pitch range.
-
setPunctuationMode(
PunctuationMode mode) → bool - Set punctuation mode to the given PunctuationMode.
-
setRate(
int value) → bool - Set voice speaking rate, where -100 is slowest and 100 is fastest.
-
setSpelling(
bool value) → bool - Switches spelling mode on and off. If set to on, all incoming messages from this particular connection will be processed according to appropriate spelling tables.
-
setVoice(
String voice) → bool - Set the speech synthesizer voice to use. Please note that synthesis voices are an attribute of the synthesizer.
-
setVolume(
int value) → bool - Set the volume of the voice and sounds produced by Speech Dispatcher’s output modules. The range is from -100 to 100.
-
soundIcon(
String iconName, {MessagePriority priority = MessagePriority.message}) → int -
Sends a sound icon
iconName. These are symbolic names that are mapped to a sound or to a text string (in the particular language) according to Speech Dispatcher tables and user settings. Each program can also define its own icons. -
stop(
) → void - Stops the message currently being spoken on a given connection. If there is no message being spoken, does nothing. (It doesn’t touch the messages waiting in queues). This is intended for stops executed by the user, not for automatic stops (because automatically you can’t control how many messages are still waiting in queues on the server).
-
stopAll(
) → void - The same as stop, but it stops every message being said, without distinguishing where it came from.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited