An EngineProperties
object defines the set of run-time
properties of an Engine
. This interface is extended for
each type of speech engine. SynthesizerProperties
and
RecognizerProperties
define the additional run-time
properties of synthesizers and recognizers respectively.
The EngineProperties
object for an Engine
is obtained from the getEngineProperties
method of the
engine, and should be cast appropriately for the type of engine.
Each property of an engine has a set and get method.
The run-time properties of an engine affect the behavior of a
running engine. Technically, properties affect engines in the
ALLOCATED
state. Normally, property changes are made
on an ALLOCATED
engine and take effect immediately or
soon after the change call.
The EngineProperties
object for an engine is, however,
available in all states of an Engine
. Changes made to the
properties of engine in the DEALLOCATED
or the
ALLOCATING_RESOURCES
state take effect when the engine next
enters the ALLOCATED
state. A typical scenario for setting
the properties of a non-allocated is determining the initial state of the
engine. For example, setting the initial voice of a
Synthesizer
, or the initial SpeakerProfile
of
a Recognizer
. (Setting these properties prior to allocation
is desirable because allocating the engine and then changing the voice
or the speaker can be computationally expensive).
When setting any engine property:
PropertyChangeListener
can be attached to the
EngineProperties
object to receive a property change
event when a change takes effect.
For example, a call to the setPitch
method of the
SynthesizerProperties
interface to change pitch from 120Hz
to 200Hz might fail because the value is out-of-range. If it does succeed,
the pitch change might be deferred until the synthesizer can make the
change by waiting to the end of the current word, sentence, paragraph or
text object. When the change does take effect, a
PropertyChangeEvent
is issued to all attached listeners
with the name of the changed property ("Pitch"), the old value (120) and
the new value (200).
Set calls take effect in the order in which they are received. If multiple changed are requested are requested for a single property, a separate event is issued for each call, even if the multiple changes take place simultaneously.
The properties of an engine are persistent across sessions where possible. It is the engine's responsibility to store and restore the property settings. In multi-user and client-server environments the store/restore policy is at the discretion of the engine.
Control Component
An engine may provide a control object through the
getControlComponent
method of its
EngineProperties
object. The control object is a GTK+
widget. If provided, that widget can be displayed to a user for
customization of the engine. Because the component is widget by the
engine, the display may support customization of engine-specific
properties that are not accessible through the standard properties
interfaces.
Properties
The set/get property patterns are followed for engine properties. A property is defined by its name and its property type (for example, "Pitch" is a float). The property is accessed through get and set methods. The signature of the property accessor methods are:
void set<PropertyName>(<PropertyType> value); <PropertyType> get<PropertyName>();
For boolean-valued properties, the get<PropertyName>()
may also be is<PropertyName>()
For indexed properties (arrays) the signature of the property accessor methods are:
void set<PropertyName>(<PropertyType>[]; value); void set<PropertyName>(int i, <PropertyType> value); <PropertyType>[] get<PropertyName>(); <PropertyType> get<PropertyName>(int i);
For example speaking rate (for a Synthesizer) is a floating value and has the following methods:
void setSpeakingRate(float value); float getSpeakingRate();
Engine
Engine#getEngineProperties
::GNOME::Speech::Recognition::RecognizerProperties
::GNOME::Speech::Synthesis::SynthesizerProperties
PropertyChangeListener
PropertyChangeEvent
Operations Summary: | |
void | addPropertyChangeListener(in EventListener listener) |
ControlComponent | getControlComponent() |
void | removePropertyChangeListener(in EventListener listener) |
void | reset() |
Operations Inherited from Bonobo::Unknown | |
ref, unref, queryInterface |
Operation Details: |
Add a PropertyChangeListener
to the listener list.
The listener is registered for all properties of the engine.
A PropertyChangeEvent
is fired in response to setting
any bound property.
PropertyChangeListener
to be added.
Obtain the GTK+ widget that provides the default user interface
for setting the properties of this Engine
.
If this Engine
has no default control panel, the
return is null
.
Engine
.
Remove a PropertyChangeListener
from the listener list.
PropertyChangeListener
to be removed.
The reset method returns all properties to reasonable defaults
for the Engine
. A property change event is issued
for each engine property that changes as the reset takes effect.