|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SpeakerManager
Provides management of speaker-specific data for a Recognizer
.
The SpeakerManager
for a Recognizer
is obtained through its
getSpeakerManager
method.
Recognizer
s that do not maintain SpeakerProfile
s
(e.g., some speaker-independent Recognizer
s) return null
for this method.
Speaker-specific data is identified with a SpeakerProfile
that is associated with information about an enrollment of a speaker (user)
with the Recognizer
.
The speaker data allows the Recognizer
to adapt to
the characteristics of the speaker under various conditions
with the goal of improving performance and recognition accuracy.
For example, the Recognizer
might adjust to vocabulary preferences
and accent.
The SpeakerManager
provides access to the known
SpeakerProfile
s, enables storage and loading of the speaker data
once a Recognizer
is running,
and provides other management functions (e.g., creation, deletion, etc).
The SpeakerManager
maintains a "current" SpeakerProfile
to identify the speaker data currently used by the Recognizer
.
SpeakerProfile
,
speaker data is not accessible to an application.
Speaker data may include:
RecognizerProperties
Recognizer
to save
speaker data. It is good practice to check with a speaker before
storing their data in case it becomes corrupted.
The SpeakerManager
interface provides a revert method which requests
the Recognizer
to restore the speaker data last saved (possibly
loaded at the start of a session).
The speaker data is potentially large, so loading, saving, reverting, and changing speaker data may all be slow operations.
The SpeakerManager
for a Recognizer
can be obtained
in any state of the Recognizer
.
However, some methods of the SpeakerManager
operate correctly only
when the Recognizer
is in the ALLOCATED
state.
The getCurrentSpeaker, setCurrentSpeaker and listKnownSpeakers methods
operate in any Recognizer
state.
This allows an initial SpeakerProfile
to be loaded before calling
the Recognizer
allocate method.
getSpeakerManager
,
SpeakerProfile
,
getSpeakerProfiles
,
EngineManager
,
allocate
Method Summary | |
---|---|
void |
createSpeaker(SpeakerProfile speaker)
Creates new speaker data for a SpeakerProfile . |
void |
deleteSpeaker(SpeakerProfile speaker)
Deletes the speaker data for a SpeakerProfile . |
SpeakerProfile |
getCurrentSpeaker()
Gets the current SpeakerProfile . |
SpeakerManagerUI |
getSpeakerManagerUI()
Returns a user interface object for managing speaker data and training. |
SpeakerProfile[] |
listKnownSpeakers()
Lists the SpeakerProfile s known to this SpeakerManager . |
void |
renameSpeaker(SpeakerProfile oldSpeaker,
SpeakerProfile newSpeaker)
Associates existing speaker data with a new SpeakerProfile . |
void |
restoreCurrentSpeaker()
Restores the speaker data for the current SpeakerProfile to
the last saved version. |
void |
saveCurrentSpeaker()
Saves the speaker data for the current SpeakerProfile . |
void |
setCurrentSpeaker(SpeakerProfile speaker)
Sets the current SpeakerProfile . |
Method Detail |
---|
void deleteSpeaker(SpeakerProfile speaker) throws IllegalArgumentException
SpeakerProfile
.
If the deleted SpeakerProfile
is the current SpeakerProfile
,
the current SpeakerProfile
is
set to SpeakerProfile.DEFAULT
.
SpeakerProfile.DEFAULT
may not be deleted.
After a successful call to this method,
the deleted SpeakerProfile
is no longer returned by listKnownSpeakers
.
speaker
- the SpeakerProfile
to delete
IllegalArgumentException
- if the SpeakerProfile
is not known or is the DEFAULT
createSpeaker
,
SpeakerProfile.DEFAULT
,
listKnownSpeakers
SpeakerManagerUI getSpeakerManagerUI()
SpeakerManager
has no default user interface,
the return value is null
and the application is responsible for
providing an appropriate user interface.
Note: because the interface is provided by the Recognizer
,
it may allow the management of additional properties that
are not otherwise accessible.
SpeakerProfile getCurrentSpeaker()
SpeakerProfile
.
SpeakerProfile.DEFAULT
is returned if
no other SpeakerProfile
is known.
SpeakerProfile
.setCurrentSpeaker
,
SpeakerProfile.DEFAULT
,
listKnownSpeakers
SpeakerProfile[] listKnownSpeakers()
SpeakerProfile
s known to this SpeakerManager
.
Returns an array containing SpeakerProfile.DEFAULT
if there are no other known SpeakerProfile
s.
The createSpeaker
, deleteSpeaker
,
and renameSpeaker
methods affect the list returned.
SpeakerProfile
screateSpeaker(javax.speech.recognition.SpeakerProfile)
,
deleteSpeaker(javax.speech.recognition.SpeakerProfile)
,
renameSpeaker(javax.speech.recognition.SpeakerProfile, javax.speech.recognition.SpeakerProfile)
,
setCurrentSpeaker
,
SpeakerProfile.DEFAULT
void createSpeaker(SpeakerProfile speaker) throws IllegalArgumentException
SpeakerProfile
.
Speaker data is identified with a SpeakerProfile
.
This method creates Recognizer
-specific data
to associate with the SpeakerProfile
.
This method does not change the current SpeakerProfile
.
After a successful call to this method,
the SpeakerProfile
is returned by listKnownSpeakers
.
The speaker
parameter must be non-null
,
contain non-null
values, and must not be equal to
any currently known SpeakerProfile
s as returned
by listKnownSpeakers
.
speaker
- a SpeakerProfile
for new speaker data
IllegalArgumentException
- if speaker
is null
,
contains invalid values, or is already knownsetCurrentSpeaker
,
deleteSpeaker
,
listKnownSpeakers
,
SpeakerProfile.equals(java.lang.Object)
void renameSpeaker(SpeakerProfile oldSpeaker, SpeakerProfile newSpeaker) throws IllegalArgumentException
SpeakerProfile
.
This allows an update of the SpeakerProfile
information
associated with the speaker data.
This method behaves like createSpeaker
followed
by deleteSpeaker
except that newSpeaker
is initialized
with speaker data from oldSpeaker
rather than default data.
Also, if oldSpeaker
is the current speaker,
then newSpeaker
becomes the current speaker.
The listKnownSpeakers
method returns a list
of known SpeakerProfile
s.
oldSpeaker
must be a known SpeakerProfile
.
newSpeaker
must be non-null
,
contain non-null
values, and must not be equal to
any currently known SpeakerProfile
s.
SpeakerProfile.DEFAULT
may not be renamed.
oldSpeaker
- a SpeakerProfile
for existing speaker datanewSpeaker
- the new SpeakerProfile
for the speaker data
IllegalArgumentException
- if either SpeakerProfile
is null
or invalid,
oldSpeaker
is not known,
or newSpeaker
is already knowncreateSpeaker
,
deleteSpeaker
,
setCurrentSpeaker
,
listKnownSpeakers
,
SpeakerProfile.DEFAULT
void restoreCurrentSpeaker() throws EngineStateException
SpeakerProfile
to
the last saved version.
If the speaker data has not been saved during the session,
the restored version will be the version loaded
at the start of the session.
If speaker data has never been saved for the
current SpeakerProfile
, then default values are restored.
Because of the potentially large size of the speaker data, this may be a slow operation.
EngineStateException
- if the engine is not ALLOCATED
saveCurrentSpeaker
,
Engine.ALLOCATED
void saveCurrentSpeaker() throws EngineStateException
SpeakerProfile
.
The speaker data is stored internally by the SpeakerManager
and
should be available for future sessions.
Use setCurrentSpeaker
or
restoreCurrentSpeaker
to load previously stored speaker data.
Because of the potentially large size of the speaker data, this may be a slow operation.
EngineStateException
- if the engine is not ALLOCATED
restoreCurrentSpeaker
,
setCurrentSpeaker
,
getCurrentSpeaker
,
Engine.ALLOCATED
void setCurrentSpeaker(SpeakerProfile speaker) throws IllegalArgumentException
SpeakerProfile
.
The SpeakerProfile
identifies speaker data and should be
one of the objects returned by the listKnownSpeakers
method.
If set before calling Recognizer.allocate
,
then any speaker data for this
SpeakerProfile
is loaded during allocation.
Otherwise, restoreCurrentSpeaker
may be
used to load the associated speaker data.
Because speaker data may store preferred user settings for the
RecognizerProperties
, those properties may change as a result
of this call.
If a speaker has not previously been set, the default is SpeakerProfile.DEFAULT.
speaker
- a SpeakerProfile to set
IllegalArgumentException
- if the SpeakerProfile
is not knowngetCurrentSpeaker
,
listKnownSpeakers
,
saveCurrentSpeaker
,
restoreCurrentSpeaker
,
RecognizerProperties
,
allocate
,
SpeakerProfile.DEFAULT
|
JSAPI 2.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Speech API 2.0,
Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.