本文整理汇总了C++中CSpEvent::Interference方法的典型用法代码示例。如果您正苦于以下问题:C++ CSpEvent::Interference方法的具体用法?C++ CSpEvent::Interference怎么用?C++ CSpEvent::Interference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSpEvent
的用法示例。
在下文中一共展示了CSpEvent::Interference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractPhonemes
//.........这里部分代码省略.........
break;
case SPERR_UNINITIALIZED:
pfnPrint( "The object has not been properly initialized.\n");
break;
case SPERR_UNSUPPORTED_FORMAT:
pfnPrint( "Audio format is bad or is not recognized. Alternatively, the device driver may be busy by another application and cannot be accessed.\n" );
break;
case SPERR_NOT_TOPLEVEL_RULE:
pfnPrint( "The rule pszName exists, but is not a top-level rule.\n" );
break;
default:
pfnPrint( "Unknown error\n" );
break;
}
pfnPrint( "Error: SAPI 5.1 Unable to activate rule set\n" );
return result;
}
// while events occur, continue processing
// timeout should be greater than the audio stream length, or a reasonable amount of time expected to pass before no more recognitions are expected in an audio stream
BOOL fEndStreamReached = FALSE;
while (!fEndStreamReached && S_OK == cpRecoContext->WaitForNotifyEvent( SR_WAVTIMEOUT ))
{
CSpEvent spEvent;
// pull all queued events from the reco context's event queue
while (!fEndStreamReached && S_OK == spEvent.GetFrom(cpRecoContext))
{
// Check event type
switch (spEvent.eEventId)
{
case SPEI_INTERFERENCE:
{
SPINTERFERENCE interference = spEvent.Interference();
switch ( interference )
{
case SPINTERFERENCE_NONE:
pfnPrint( "[ I None ]\r\n" );
break;
case SPINTERFERENCE_NOISE:
pfnPrint( "[ I Noise ]\r\n" );
break;
case SPINTERFERENCE_NOSIGNAL:
pfnPrint( "[ I No Signal ]\r\n" );
break;
case SPINTERFERENCE_TOOLOUD:
pfnPrint( "[ I Too Loud ]\r\n" );
break;
case SPINTERFERENCE_TOOQUIET:
pfnPrint( "[ I Too Quiet ]\r\n" );
break;
case SPINTERFERENCE_TOOFAST:
pfnPrint( "[ I Too Fast ]\r\n" );
break;
case SPINTERFERENCE_TOOSLOW:
pfnPrint( "[ I Too Slow ]\r\n" );
break;
default:
break;
}
}
break;
case SPEI_PHRASE_START:
pfnPrint( "Phrase Start\r\n" );
sentence.MarkNewPhraseBase();