Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Interface javax.speech.recognition.SpeakerManager


public abstract interface SpeakerManager
Provides control of SpeakerProfiles for a Recognizer. The SpeakerManager for a Recognizer is obtained through its getSpeakerManager method. Recognizers that do not maintain speaker profiles - known as speaker-independent recognizers return null for this method.

Each SpeakerProfile stored with a Recognizer stored information about an enrollment of a user with the recognizer. The user information allows the recognizer to adapt to the characteristic of the user with the goal of improving performance and recognition accuracy. For example, the recognizer might adjust to vocabulary preferences and accent.

The role of the SpeakerManager is provide access to the known SpeakerProfiles, to enable storage and loading of the profiles once a recognizer is running, and to provide other management functions (storage to file, deletion etc). The SpeakerManager has a "current speaker" - the profile which is currently being used by the recognizer.

Storing and Loading

Speaker data is typically persistent - a user will want their profile to be available from session to session. An application must explicitly request a recognizer to save a speaker profile. It is good practice to check with a user before storing their speaker profile in case it has become corrupted.

The SpeakerManager interface provides a revert method which requests the engine to restore the last saved profile (possibly the profile loaded at the start of a session).

The speaker profile is potentially a large amount of data (often up to several MByte). So loading and storing profiles, reverting to an old profile and changing speakers may all be slow operations.

The SpeakerManager provides methods to load and store speaker profiles to and from streams (e.g. files, URLs). Speaker profiles contain engine-specific and often proprietary information, so a speaker profile from one recognizer can not usually be loaded into a recognizer from a different company.

The SpeakerManager for a Recognizer can be obtained from the Recognizer in any state of the recognizer. However, most methods of the SpeakerManager operate correctly only when the Recognizer is in the ALLOCATED.

The getCurrentSpeaker, setCurrentSpeaker and listKnownSpeakers methods operate in any Recognizer state. This allows the initial speaker profile for a Recognizer to be loaded at allocation time.

See Also:
SpeakerProfile, getSpeakerProfiles, Central, System

Method Summary
void deleteSpeaker(SpeakerProfile speaker)
          Delete a SpeakerProfile.
Component getControlComponent()
          Obtain a component that provides the engine's user interface for managing speaker data and training.
SpeakerProfile getCurrentSpeaker()
          Get the current SpeakerProfile.
SpeakerProfile[] listKnownSpeakers()
          List the SpeakerProfiles known to this Recognizer.
SpeakerProfile newSpeakerProfile(SpeakerProfile profile)
          Create a new SpeakerProfile for this Recognizer.
SpeakerProfile readVendorSpeakerProfile(InputStream in)
          Read a SpeakerProfile from a stream and return a reference to it.
void revertCurrentSpeaker()
          Restore the speaker profile for the current speaker to the last saved version.
void saveCurrentSpeakerProfile()
          Save the speaker profile for the current speaker.
void setCurrentSpeaker(SpeakerProfile speaker)
          Set the current SpeakerProfile.
void writeVendorSpeakerProfile(OutputStream out, SpeakerProfile speaker)
          Write the speaker profile of the named speaker to a stream.
 

Method Detail

setCurrentSpeaker

public void setCurrentSpeaker(SpeakerProfile speaker)
                      throws IllegalArgumentException
Set the current SpeakerProfile. The SpeakerProfile object should be one of the objects returned by the listKnownSpeakers method.

Because a SpeakerProfile may store preferred user settings for the RecognizerProperties, those properties may change as a result of this call.

Throws:
IllegalArgumentException - if the speaker is not known

getCurrentSpeaker

public SpeakerProfile getCurrentSpeaker()
Get the current SpeakerProfile. Returns null if there is no current speaker.

listKnownSpeakers

public SpeakerProfile[] listKnownSpeakers()
List the SpeakerProfiles known to this Recognizer. Returns null if there is no known speaker.

newSpeakerProfile

public SpeakerProfile newSpeakerProfile(SpeakerProfile profile)
                                                         throws IllegalArgumentException
Create a new SpeakerProfile for this Recognizer. The SpeakerProfile object returned by this method is different from the object passed to the method. The input profile contains the new id, name and variant. The returned object is a reference to a recognizer-internal profile with those settings but with all the additional recognizer-specific information associated with a profile.

This method does not change the current speaker.

If the input profile's identifier or user name is not specified (is null), the recognizer should assign a unique temporary identifier. The application should request that the user update the id.

If the input profile is null, the recognizer should assign a temporary id and user name. The application should query the user for details.

Throws:
IllegalArgumentException - if the speaker id is already being used

deleteSpeaker

public void deleteSpeaker(SpeakerProfile speaker)
                  throws IllegalArgumentException
Delete a SpeakerProfile. If the deleted speaker is the current speaker, the current speaker is set to null.

Throws:
IllegalArgumentException - if the speaker is not known

saveCurrentSpeakerProfile

public void saveCurrentSpeakerProfile()
Save the speaker profile for the current speaker. The speaker profile is stored internally by the recognizer and should be available for future sessions.

Because of the large potential size of the speaker profile, this may be a slow operation.

See Also:
revertCurrentSpeaker, writeVendorSpeakerProfile

revertCurrentSpeaker

public void revertCurrentSpeaker()
Restore the speaker profile for the current speaker to the last saved version. If the speaker profile has not been saved during the session, the restored version will be the version loaded at the start of the session.

Because of the large potential size of the speaker profile, this may be a slow operation.

See Also:
saveCurrentSpeakerProfile, readVendorSpeakerProfile

writeVendorSpeakerProfile

public void writeVendorSpeakerProfile(OutputStream out,
                                      SpeakerProfile speaker)
                              throws IOException
Write the speaker profile of the named speaker to a stream. This method allows speaker data to be stored and to be transferred between machines.

The speaker profile is stored in a vendor-specific format, so it can only be loaded into a recognizer that understands that format - typically a recognizer from the same provider. Speaker profiles are loaded with the readVendorSpeakerProfile method.

Note: The speaker profile is potentially large (up to several MByte).

Throws:
IOException - if an I/O error occurs
See Also:
readVendorSpeakerProfile

readVendorSpeakerProfile

public SpeakerProfile readVendorSpeakerProfile(InputStream in)
                                                                throws IOException,
                                                                       VendorDataException
Read a SpeakerProfile from a stream and return a reference to it. This method loads data that may have been stored previously with the writeVendorSpeakerProfile method.

If the speaker profile contained in the input stream already exists, the recognizer should create a modified name. An application should inform the user of the name that is loaded and consider giving them an option to modify it.

Since speaker profiles are stored in vendor-specific formats, they can only be loaded into a recognizer that understands that format - typically a recognizer from the same provider.

Note: The speaker profile is potentially large (up to several MByte).

Throws:
VendorDataException - if the data format is not known to the recognizer
IOException - if an I/O error occurs
See Also:
writeVendorSpeakerProfile

getControlComponent

public Component getControlComponent()
Obtain a component that provides the engine's user interface for managing speaker data and training. If this Recognizer has no default control panel, the return value is null and the application is responsible for providing an appropriate control panel.

Note: because the interface is provided by the recognizer, it may allow the management of properties that are not otherwise accessible through the standard API.


Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com