com.cloudgarden.speech
Class CGSpeakableEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--javax.speech.SpeechEvent
              |
              +--javax.speech.synthesis.SpeakableEvent
                    |
                    +--com.cloudgarden.speech.CGSpeakableEvent
All Implemented Interfaces:
java.io.Serializable

public class CGSpeakableEvent
extends SpeakableEvent

Extends SpeakableEvent to provide information on lip-sync events. If the event has an id of VISEME, mouth-shape parameters can be extracted from it by first calling convertToMouthShapeEvent.

See Also:
Serialized Form

Field Summary
static int COMMAND
           
static int EMPHASIS
           
static int EXCLAMATION
           
static int MOUTH_SHAPE
           
static int PHONEME
           
static int QUESTION
           
static int STATEMENT
           
static int UNKNOWN
           
static int VISEME
           
static int VISEME_AA
           
static int VISEME_AE_AX_AH
           
static int VISEME_AO
           
static int VISEME_AW
           
static int VISEME_AY
           
static int VISEME_D_T_N
           
static int VISEME_ER
           
static int VISEME_EY_EH_UH
           
static int VISEME_F_V
           
static int VISEME_H
           
static int VISEME_K_G_NG
           
static int VISEME_L
           
static int VISEME_OW
           
static int VISEME_OY
           
static int VISEME_P_B_M
           
static int VISEME_R
           
static int VISEME_S_Z
           
static int VISEME_SH_CH_JH_ZH
           
static int VISEME_SILENCE
           
static int VISEME_TH_DH
           
static int VISEME_W_UW
           
static int VISEME_Y_IY_IH_IX
           
 
Fields inherited from class javax.speech.synthesis.SpeakableEvent
ELEMENT_CLOSE, ELEMENT_EMPTY, ELEMENT_OPEN, MARKER_REACHED, markerType, SPEAKABLE_CANCELLED, SPEAKABLE_ENDED, SPEAKABLE_PAUSED, SPEAKABLE_RESUMED, SPEAKABLE_STARTED, text, TOP_OF_QUEUE, WORD_STARTED, wordEnd, wordStart
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CGSpeakableEvent(java.lang.Object source, int id, int viseme, int phoneme)
           
 
Method Summary
 void convertToMouthShapeEvent()
          If this event was a VISEME event, generate mouth-shape parameters corresponding to the viseme.
 int getJawOpen()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the openess of the jaw.
 int getLipTension()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the horizontal tension of the lips.
 int getMouthHeight()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total height of the mouth (from min height to max height)
 int getMouthUpturn()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total upturn of the mouth (from max downturn to max upturn)
 int getMouthWidth()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total width of the mouth (from min width to max width)
 int getPhoneme()
          If from a SAPI4 engine, returns the IPA phoneme corresponding to this event, otherwise, if from a SAPI5 engine, returns the Microsoft PhoneID for this sound - you will need to translate from the PhoneID to a unicode value.
 int getSentenceType()
          Returns one of the fields UNKNOWN, COMMAND, EMPHASIS, EXCLAMATION, QUESTION or STATEMENT if the event is a VISEME or MOUTH_SHAPE event.
 int getTeethLowerVisible()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the visibility of the lower teeth.
 int getTeethUpperVisible()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the visibility of the upper teeth.
 int getTonguePosn()
          If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the position of the tongue (0 being lowest, 255 being highest).
 int getViseme()
          Returns one of the VISEME_XX fields corresponding to this event
 boolean isMSPhoneID()
          Returns true if the value returned by getPhoneme is a Microsoft PhoneID (true for SAPI5 engines).
 
Methods inherited from class javax.speech.synthesis.SpeakableEvent
getMarkerType, getText, getWordEnd, getWordStart
 
Methods inherited from class javax.speech.SpeechEvent
getId, paramString
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOUTH_SHAPE

public static final int MOUTH_SHAPE

VISEME

public static final int VISEME

PHONEME

public static final int PHONEME

UNKNOWN

public static final int UNKNOWN

COMMAND

public static final int COMMAND

EMPHASIS

public static final int EMPHASIS

EXCLAMATION

public static final int EXCLAMATION

QUESTION

public static final int QUESTION

STATEMENT

public static final int STATEMENT

VISEME_SILENCE

public static final int VISEME_SILENCE

VISEME_AE_AX_AH

public static final int VISEME_AE_AX_AH

VISEME_AA

public static final int VISEME_AA

VISEME_AO

public static final int VISEME_AO

VISEME_EY_EH_UH

public static final int VISEME_EY_EH_UH

VISEME_ER

public static final int VISEME_ER

VISEME_Y_IY_IH_IX

public static final int VISEME_Y_IY_IH_IX

VISEME_W_UW

public static final int VISEME_W_UW

VISEME_OW

public static final int VISEME_OW

VISEME_AW

public static final int VISEME_AW

VISEME_OY

public static final int VISEME_OY

VISEME_AY

public static final int VISEME_AY

VISEME_H

public static final int VISEME_H

VISEME_R

public static final int VISEME_R

VISEME_L

public static final int VISEME_L

VISEME_S_Z

public static final int VISEME_S_Z

VISEME_SH_CH_JH_ZH

public static final int VISEME_SH_CH_JH_ZH

VISEME_TH_DH

public static final int VISEME_TH_DH

VISEME_F_V

public static final int VISEME_F_V

VISEME_D_T_N

public static final int VISEME_D_T_N

VISEME_K_G_NG

public static final int VISEME_K_G_NG

VISEME_P_B_M

public static final int VISEME_P_B_M
Constructor Detail

CGSpeakableEvent

public CGSpeakableEvent(java.lang.Object source,
                        int id,
                        int viseme,
                        int phoneme)
Method Detail

convertToMouthShapeEvent

public void convertToMouthShapeEvent()
If this event was a VISEME event, generate mouth-shape parameters corresponding to the viseme.

getSentenceType

public int getSentenceType()
Returns one of the fields UNKNOWN, COMMAND, EMPHASIS, EXCLAMATION, QUESTION or STATEMENT if the event is a VISEME or MOUTH_SHAPE event.

getMouthHeight

public int getMouthHeight()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total height of the mouth (from min height to max height)

getMouthWidth

public int getMouthWidth()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total width of the mouth (from min width to max width)

getMouthUpturn

public int getMouthUpturn()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the total upturn of the mouth (from max downturn to max upturn)

getJawOpen

public int getJawOpen()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the openess of the jaw.

getTeethUpperVisible

public int getTeethUpperVisible()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the visibility of the upper teeth.

getTeethLowerVisible

public int getTeethLowerVisible()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the visibility of the lower teeth.

getTonguePosn

public int getTonguePosn()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the position of the tongue (0 being lowest, 255 being highest).

getLipTension

public int getLipTension()
If this is a MOUTH_SHAPE event (or a VISEME event after convertToMouthShapeEvent has been called), returns a number from 0 to 255 specifying the horizontal tension of the lips.

getViseme

public int getViseme()
Returns one of the VISEME_XX fields corresponding to this event

getPhoneme

public int getPhoneme()
If from a SAPI4 engine, returns the IPA phoneme corresponding to this event, otherwise, if from a SAPI5 engine, returns the Microsoft PhoneID for this sound - you will need to translate from the PhoneID to a unicode value.

The reason that this is not done automatically for you is that in the English PhoneID set, four PhoneIDs (namely 14, 16, 18 and 36 ) correspond to dipthongs (ie, two phonemes each), and also that the translation is language-dependent.

The English PhoneIDs and their unicode translations are documented in the "SAPI5Pronunciations.html" file which comes with the TalkingJava SDK.

See Also:
isMSPhoneID()

isMSPhoneID

public boolean isMSPhoneID()
Returns true if the value returned by getPhoneme is a Microsoft PhoneID (true for SAPI5 engines).
See Also:
getPhoneme()