Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CVisageLinkDoc Class Reference

Main document class. More...

#include <VisageLinkDoc.h>

Inheritance diagram for CVisageLinkDoc:

Visagesapi5ttsObserver List of all members.

Public Member Functions

void Notify (Visagesapi5tts *vtts, FBAPs *faps, CodingParameters *cp, long pts)
 Processing of the TTS viseme notification events.

void BookMark (Visagesapi5tts *vtts, long qTimeStamp, DWORD dwMarkNum, WCHAR *markText)
 Processing of the TTS bookmark events.

void StartSpeech (Visagesapi5tts *vtts, WCHAR *text)
 Processing of the TTS start speech events.

void CheckFiles ()
 Check if all necessary files are present.


Public Attributes

FAPlayer * m_FAPlayer
 The FAPlayer.

Visagesapi5tts * vtts
 The Visage TTS.

SimpleVORAction * vor
 The Vestibolo-Ocular Reflex (gaze following) action.

bool animationStarted
 Animation started flag.


Protected Member Functions

afx_msg void OnFileStart ()
 Initialize everything and start the animation.

afx_msg void OnFileSpeak ()
 Speak.

afx_msg void OnOptionsGazefollowingvor ()
 Enable gaze following (vestibulo-ocular reflex).

afx_msg void OnOptionsDisablegazefollowingvor ()
 Disable gaze following (vestibulo-ocular reflex).


Detailed Description

Main document class.

Implements the necessary functions of FARenderer and Visagesapi5ttsObserver.

Definition at line 78 of file VisageLinkDoc.h.


Member Function Documentation

void CVisageLinkDoc::BookMark Visagesapi5tts *  vtts,
long  qTimeStamp,
DWORD  dwMarkNum,
WCHAR *  markText
[virtual]
 

Processing of the TTS bookmark events.

This function is the implementation of a virtual function from the Visagesapi5ttsObserver class. It is not to be called directly. Rather, the instance of CVisageLinkDoc is attached to the Visagesapi5tts, which calls the BookMark() function as appropriate, and passes the appropriate parameters to it.

In this example we use the bookmarks to insert simple facial expressions or animations at particular times during the speech. This is done by playing a SimpleFacialExpression. The expression is initialized with the name from the bookmark tag, e.g. "surprise" or "joy". See SimpleFacialExpression for the list of supported expression names.

The other bookmark that can occur is "wave", and if it is found we insert a simple waving animation - just moving the right hand.

Parameters:
qTimeStamp bookmark time stamp in milliseconds. This is bookmark's TTS speech bit stream time.
dwMarkNum bookmark code number (the number that was entered in the SAPI control tag as \Mrk=number\.
vtts instance of Visagesapi5tts that called the function; this can be used for identification if more than one Visagesapi5tts object is used at the same time
See also:
Visagesapi5ttsObserver

SimpleFacialExpression

Implements Visagesapi5ttsObserver.

Definition at line 160 of file VisageLinkDoc.cpp.

References m_FAPlayer, and FAPlayer::playTrack().

void CVisageLinkDoc::CheckFiles  ) 
 

Check if all necessary files are present.

All the file names in this example are hard-coded. This function checks if the files are actually present and gives error messages if they are not. The example should be run in the VisageLink folder where all necessary files are present.

Definition at line 244 of file VisageLinkDoc.cpp.

Referenced by OnFileStart().

void CVisageLinkDoc::Notify Visagesapi5tts *  vtts,
FBAPs *  fbaps,
CodingParameters *  cp,
long  pts
[virtual]
 

Processing of the TTS viseme notification events.

This function is the implementation of a virtual function from the Visagesapi5ttsObserver class. It is not to be called directly. Rather, the instance of CVisageLinkDoc is attached to the Visagesapi5tts, which calls the Notify() function as appropriate, and passes the appropriate parameters to it.

This gives the possibility of additional control over the animation parameters generated by TTS. In this example we do not use it so it is empty.

Parameters:
faps pointer to FAPs structure, or NULL at the end of speech.
cp pointer to the coding parameters used when encoding the animation into a file;
pts current TTS speech bit stream time in milliseconds.
vtts instance of Visagesapi5tts that called the function; this can be used for identification if more than one Visagesapi5tts object is used at the same time
See also:
Visagesapi5ttsObserver

preRender()

Implements Visagesapi5ttsObserver.

Definition at line 135 of file VisageLinkDoc.cpp.

void CVisageLinkDoc::OnFileSpeak  )  [protected]
 

Speak.

This method is called when the File->Speak menu option is selected. It reads the speech from the file and pronounces it using the speech synthesis object vtts.

Definition at line 341 of file VisageLinkDoc.cpp.

References animationStarted, Visagesapi5tts::speak(), and vtts.

void CVisageLinkDoc::OnFileStart  )  [protected]
 

Initialize everything and start the animation.

This method is called when the File->Start menu option is selected. It performs all necessary initializations, and starts the FAPlayer.

Specifically:

  • a check is performed to see if all required files are present
  • a face/body model is loaded and attached to the FAPlayer
  • a base animation track (simple head motion and eye blinks) is loaded from file into the player; it will loop forever. This makes the animation look nicer, and provides some basic action to the FAPlayer so that it continues playing (if the player is empty, the play() method would just return because there is nothing to play)
  • the specch synthesis object vtts is initialised and added as an animation track to the player
  • the rendering mechanism is started
  • the FAPlayer play() method is called to start the player.

Definition at line 301 of file VisageLinkDoc.cpp.

References FAPlayer::addTrack(), animationStarted, Visagesapi5tts::attach(), CheckFiles(), FAPlayer::getFaceModel(), CMainFrame::GetOpenGLWnd(), COpenGLWnd::Init(), FAPlayer::init(), m_FAPlayer, FAPlayer::play(), Visagesapi5tts::setSpeaker(), FbaFileAction::smoothZeroValues(), and vtts.

void CVisageLinkDoc::OnOptionsDisablegazefollowingvor  )  [protected]
 

Disable gaze following (vestibulo-ocular reflex).

This method is called when the File->Disable Gaze Following menu option is selected.

It disables the gaze following (vestibulo-ocular reflex) by removing the vor object (a SimpleVORAction) from the FAPlayer.

See also:
SimpleVORAction

Definition at line 385 of file VisageLinkDoc.cpp.

References m_FAPlayer, FAPlayer::removeTrack(), and vor.

void CVisageLinkDoc::OnOptionsGazefollowingvor  )  [protected]
 

Enable gaze following (vestibulo-ocular reflex).

This method is called when the File->Enable Gaze Following menu option is selected.

It enables the gaze following (vestibulo-ocular reflex) by attaching the vor object (a SimpleVORAction) to the FAPlayer.

See also:
SimpleVORAction

Definition at line 367 of file VisageLinkDoc.cpp.

References FAPlayer::addTrack(), m_FAPlayer, and vor.

void CVisageLinkDoc::StartSpeech Visagesapi5tts *  vtts,
WCHAR *  text
[virtual]
 

Processing of the TTS start speech events.

This function is the implementation of a virtual function from the Visagesapi5ttsObserver class. It is not to be called directly. Rather, the instance of CVisageLinkDoc is attached to the Visagesapi5tts, which calls the StartSpeech() function as appropriate, and passes the appropriate parameters to it.

In this example we use the bookmarks to insert simple expressions and animations at particular times during the speech. Some bookmarks are already inserted in the input text file. We use this function as a simple filter to insert additional bookmarks.

So, when the string "surpr" is encountered, a bookmark for the surprize expression is inserted.

This is a very simple example of using the Visagesapi5ttsObserver for processing the text and inserting appropriate actions.

Parameters:
qTimeStamp bookmark time stamp in milliseconds. This is bookmark's TTS speech bit stream time.
dwMarkNum bookmark code number (the number that was entered in the SAPI control tag as \Mrk=number\.
vtts instance of Visagesapi5tts that called the function; this can be used for identification if more than one Visagesapi5tts object is used at the same time
See also:
Visagesapi5ttsObserver

SimpleFacialExpression

Implements Visagesapi5ttsObserver.

Definition at line 198 of file VisageLinkDoc.cpp.

References Visagesapi5tts::toUnicode().


Member Data Documentation

bool CVisageLinkDoc::animationStarted
 

Animation started flag.

This flags indicates that the basic animation is started and everything is initialised and ready for speaking..

Definition at line 107 of file VisageLinkDoc.h.

Referenced by OnFileSpeak(), and OnFileStart().

FAPlayer* CVisageLinkDoc::m_FAPlayer
 

The FAPlayer.

The Face Animation Player (FAPlayer). It is used to load and play animation and corresponding sound.

Definition at line 90 of file VisageLinkDoc.h.

Referenced by BookMark(), OnFileStart(), OnOptionsDisablegazefollowingvor(), and OnOptionsGazefollowingvor().

SimpleVORAction* CVisageLinkDoc::vor
 

The Vestibolo-Ocular Reflex (gaze following) action.

Definition at line 101 of file VisageLinkDoc.h.

Referenced by OnOptionsDisablegazefollowingvor(), and OnOptionsGazefollowingvor().

Visagesapi5tts* CVisageLinkDoc::vtts
 

The Visage TTS.

The TTS object used for speaking.

Definition at line 96 of file VisageLinkDoc.h.

Referenced by OnFileSpeak(), and OnFileStart().


The documentation for this class was generated from the following files:
Generated on Wed Nov 8 16:13:38 2006 for VisageLink by doxygen 1.3.1