Logo

void sapi_lipsync::print_results std::ostream &  os  )  [virtual]
 

prints the current best results to the specified stream

This method prints the results of the lipsync (word alignment) to an output stream of choice.

It is printed in a format that can be directly loaded in "The Lipsync Tool" http://www.annosoft.com/demos.htm. You can download the free version to see the results (with annosoft's nice smoothing of the phonemes)

The format of the results see .anno file format.

For the output, since we don't have an energy value, we just use "75" percent. Other readers can ignore this parameter.

Note:
sapi_lipsync::finalize_phoneme_alignment should be called before calling this method.
Parameters:
os - [in] stream to print the results to

Reimplemented in sapi_textbased_lipsync.

Definition at line 347 of file sapi_lipsync.cpp.

00348 {
00349 
00350     std::vector<alignment_result>::iterator p, pEnd;
00351     p = m_results.begin();
00352     pEnd = m_results.end();
00353     // print the audio result
00354     if (m_strAudioFile.size())
00355     {
00356         os << "audio " << wstring_2_string(m_strAudioFile) << std::endl;
00357     }
00358     while (p != pEnd)
00359     {
00360         // print the word marker
00361         if (p->m_orthography.size())
00362         {
00363             os << "word " << p->m_msStart << ' ' << p->m_msEnd <<
00364                 ' ' << wstring_2_string(p->m_orthography) << std::endl;
00365         }
00366         // print the phn markers
00367         long pos = p->m_msStart;
00368         for (unsigned long j = 0; j < p->m_phonemes.size(); j++)
00369         {
00370             long start = pos; 
00371             long end = p->m_phonemeEndTimes[j];
00372             os << "phn " << start << ' ' << end << ' ' << 75 <<
00373                 ' ' << wstring_2_string(p->m_phonemes[j]) << std::endl;
00374             pos = end;
00375         }
00376         p++;
00377     }
00378 }


Copyright (C) 2002-2005 Annosoft LLC. All Rights Reserved.
Visit us at www.annosoft.com