JSAPI 2.0

javax.speech.recognition
Class SpeakerProfile

Object
  extended by SpeakerProfile

public class SpeakerProfile
extends Object

Identifies speaker data in a SpeakerManager. SpeakerProfile objects are used in management of speaker data through the SpeakerManager interface for a Recognizer.

A user may have one or more profiles associated with a SpeakerManager. A user may want multiple profiles to enroll and train separately for different microphones or for different application domains (e.g., name dialing and command and control).

Each SpeakerProfile object has a user name, and a variant name that identifies each separate profile for a user (per-user unique). The properties should be human-readable Strings.

The user name may be the same as the "user.name" property stored in the java.lang.System properties. However, access to System properties may be restricted by security policies.

Appropriate application of SpeakerProfiles is the joint responsibility of applications and SpeakerManagers. Applications should ensure that the property values are meaningful and SpeakerManagers should ensure the integrity of the associated speaker data.

See Also:
Recognizer, RecognizerMode, SpeakerManager, System

Field Summary
static SpeakerProfile DEFAULT
          The default SpeakerProfile is used if no other speaker has been set.
 
Constructor Summary
SpeakerProfile(String name, String variant)
          Constructs a SpeakerProfile with the specified properties.
 
Method Summary
 boolean equals(Object obj)
          Returns true if and only if the parameter is not null and is a SpeakerProfile with equal values.
 String getName()
          Returns the speaker name.
 String getVariant()
          Gets the variant description.
 int hashCode()
          Returns a hash code value for the object.
 boolean match(SpeakerProfile required)
          Returns true if this object matches the required object.
 String toString()
          Returns a String representation of this SpeakerProfile.
 
Methods inherited from class Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT

public static final SpeakerProfile DEFAULT
The default SpeakerProfile is used if no other speaker has been set.

Note that this default value uses empty Strings for the property values of this class. Applications should present a properly localized representation of "default" in user interfaces.

See Also:
setCurrentSpeaker
Constructor Detail

SpeakerProfile

public SpeakerProfile(String name,
                      String variant)
Constructs a SpeakerProfile with the specified properties.

The SpeakerProfile identifies speaker data in the SpeakerManager. The name and variant should be human-readable Strings.

The SpeakerManager expects non-null, distinct SpeakerProfiles (not equal) when managing speaker data.

null parameter values may be used for "don't care" values in association with RecognizerMode and Recognizer selection. See getSpeakerProfiles for details.

Parameters:
name - the speaker name
variant - a String distinguishing multiple SpeakerProfiles for the same speaker
See Also:
getName, getVariant, equals, RecognizerMode, RecognizerMode.getSpeakerProfiles(), Recognizer, SpeakerManager
Method Detail

equals

public boolean equals(Object obj)
Returns true if and only if the parameter is not null and is a SpeakerProfile with equal values.

Overrides:
equals in class Object
Parameters:
obj - a SpeakerProfile to compare
Returns:
true if the SpeakerProfile objects compare

getName

public String getName()
Returns the speaker name. Should be unique for a user when associated with speaker data.

Returns:
the speaker's name.
See Also:
getVariant, SpeakerProfile

getVariant

public String getVariant()
Gets the variant description. This is used to distinguish multiple SpeakerProfiles for a single speaker. It should be unique for a given user and condition when associated with speaker data.

Returns:
the variant description.
See Also:
getName, SpeakerProfile

hashCode

public int hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hashtables.

Overrides:
hashCode in class Object
Returns:
a hash code value for the object

match

public boolean match(SpeakerProfile required)
Returns true if this object matches the required object. A match requires that each non-null or non-zero-length String property of the required object be an exact String match to the properties of this object.

Parameters:
required - a SpeakerProfile with the required values
Returns:
true if the SpeakerProfiles match
See Also:
equals

toString

public String toString()
Returns a String representation of this SpeakerProfile.

Overrides:
toString in class Object
Returns:
a String representation of this SpeakerProfile

JSAPI 2.0

JavaTM Speech API 2.0, Final Release v2.0.6.
© 2008, Conversay and Sun Microsystems.

Free Web Hosting