Logo

std::wstring sapi_textbased_lipsync::preprocess_text const std::wstring &  in  )  [static]
 

SAPI 5.1 is picky about the data input into the Command and Control system.

This method preprocesses the transcription text removing characters that cause problems with alignment.

If it finds a dirty character or sequence of them it replaces them with pure white space. This definitely improves things.

Parameters:
in - transcription
Return values:
transcription modified with bad characters/punctuation removed.

Definition at line 645 of file sapi_lipsync.cpp.

00646 {
00647     std::wstring::const_iterator p, pEnd;
00648     std::wstring out;
00649     p = in.begin();
00650     pEnd = in.end();
00651     while (p != pEnd)
00652     {
00653         if (is_dirty_char(*p))
00654         {
00655             while (p != pEnd && is_dirty_char(*p))
00656                 p++;
00657             out += L" ";
00658         }
00659         if (p != pEnd)
00660         {
00661             out += *p;
00662             p++;
00663         }
00664     }
00665     bstr_t ist = out.c_str();
00666     std::cerr << (const char*)ist << std::endl;
00667     return (out);
00668 }


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