📄 adsapigr.pas
字号:
{*********************************************************}
{* ADSAPIGR.PAS 4.04 *}
{* Copyright (C) TurboPower Software 2002 *}
{* All rights reserved. *}
{*********************************************************}
{Global defines potentially affecting this unit}
{$I AWDEFINE.INC}
unit AdSapiGr;
interface
resourcestring
{ AskFor xxx Prompts }
ApdAskAreaCode = 'What is the area code?';
ApdAskLastFour = 'What are the last four digits of the phone number?';
ApdAskNextThree = 'What are the next three digits of the phone number?';
ApdCannotGoBack = 'Cannot go back.';
ApdCannotHangUp = 'Cannot hang up now.';
ApdHangingUp = 'Goodbye.';
ApdHelp = 'This is help.';
ApdHelp2 = 'This is additional help.';
ApdHelpVerify = 'You can speak yes or no, or press 1 for yes, or 2 for no.';
ApdGoingBack = 'Going back.';
ApdMain = 'Please say something.';
ApdMain2 = 'Please say the something. - Shorter prompt';
ApdMaxSpeed = 'I am speaking as fast as I can.';
ApdMinSpeed = 'I am speaking as slowly as I can.';
ApdOperator = 'Connecting to an operator.';
ApdNoOperator = 'An operator is not available.';
ApdNoSpeedChange = 'Cannot change speed.';
ApdSpeakingFaster = 'Speaking faster.';
ApdSpeakingSlower = 'Speaking slower.';
ApdTooFewDigits = 'Not enough digits for the extension.';
ApdTooManyDigits = 'Too many digits for the extension.';
ApdUnrecognized = 'Sorry, I didn''t understand.';
ApdVerifyPost = 'Is this correct?';
ApdVerifyPre = 'I heard:';
ApdWhere = 'You are somewhere.';
ApdWhere2 = 'You are somewhere - Shorter prompt.';
ApdYouHaveSpelled = 'You have spelled: ';
{ Error Codes }
{ SAPI Engine }
ecApdNoSS = 'Speech synthesis engine is not assigned';
ecApdNoSR = 'Speech recognition engine is not assigned';
ecApdBadIndex = 'Invalid speech engine';
ecNoSREngines = 'No speech recognition engines are installed';
ecNoSSEngines = 'No speech synthesis engines are installed';
{ SAPI Phone }
ecApdNoSapiEngine = 'No SAPI engine';
ecApdNoPrompts = 'No prompts';
ecApdBadDeviceNum = 'Unable to set device number: ';
ecApdCannotCreateCOM = 'Cannot create COM Object';
ecApdNotPhone = 'SAPI Engine is not phone optimized';
{ More error strings }
{SS}
ApdStrTTSERR_INVALIDINTERFACE = 'Invalid interface';
ApdStrTTSERR_OUTOFDISK = 'Out of disk space';
ApdStrTTSERR_NOTSUPPORTED = 'Not supported';
ApdStrTTSERR_VALUEOUTOFRANGE = 'Value out of range';
ApdStrTTSERR_INVALIDWINDOW = 'Invalid window';
ApdStrTTSERR_INVALIDPARAM = 'Invalid parameter';
ApdStrTTSERR_INVALIDMODE = 'Invalid mode';
ApdStrTTSERR_INVALIDKEY = 'Invalid key';
ApdStrTTSERR_WAVEFORMATNOTSUPPORTED = 'Wave format not supported';
ApdStrTTSERR_INVALIDCHAR = 'Invalid character';
ApdStrTTSERR_QUEUEFULL = 'Queue full';
ApdStrTTSERR_WAVEDEVICEBUSY = 'Wave device busy';
ApdStrTTSERR_NOTPAUSED = 'Not paused';
ApdStrTTSERR_ALREADYPAUSED = 'Already paused';
{SR}
ApdStrSRERR_OUTOFDISK = 'Out of disk space';
ApdStrSRERR_NOTSUPPORTED = 'Not supported';
ApdStrSRERR_NOTENOUGHDATA = 'Not enough data';
ApdStrSRERR_VALUEOUTOFRANGE = 'Value out of range';
ApdStrSRERR_GRAMMARTOOCOMPLEX = 'Grammar too complex';
ApdStrSRERR_GRAMMARWRONGTYPE = 'Grammar is of the wrong type';
ApdStrSRERR_INVALIDWINDOW = 'Invalid window';
ApdStrSRERR_INVALIDPARAM = 'Invalid parameter';
ApdStrSRERR_INVALIDMODE = 'Invalid mode';
ApdStrSRERR_TOOMANYGRAMMARS = 'Too many grammars';
ApdStrSRERR_INVALIDLIST = 'Invalid list';
ApdStrSRERR_WAVEDEVICEBUSY = 'Wave device busy';
ApdStrSRERR_WAVEFORMATNOTSUPPORTED = 'Wave format not supported';
ApdStrSRERR_INVALIDCHAR = 'Invalid character';
ApdStrSRERR_GRAMTOOCOMPLEX = 'Grammar too complex';
ApdStrSRERR_GRAMTOOLARGE = 'Grammar too large';
ApdStrSRERR_INVALIDINTERFACE = 'Invalid interface';
ApdStrSRERR_INVALIDKEY = 'Invalid key';
ApdStrSRERR_INVALIDFLAG = 'Invalid flag';
ApdStrSRERR_GRAMMARERROR = 'Grammar error';
ApdStrSRERR_INVALIDRULE = 'Invalid rule';
ApdStrSRERR_RULEALREADYACTIVE = 'Rule already active';
ApdStrSRERR_RULENOTACTIVE = 'Rule not active';
ApdStrSRERR_NOUSERSELECTED = 'No users selected';
ApdStrSRERR_BAD_PRONUNCIATION = 'Bad pronunciation';
ApdStrSRERR_DATAFILEERROR = 'Data file error';
ApdStrSRERR_GRAMMARALREADYACTIVE = 'Grammar already active';
ApdStrSRERR_GRAMMARNOTACTIVE = 'Grammar not active';
ApdStrSRERR_GLOBALGRAMMARALREADYACTIVE = 'Global grammar already active';
ApdStrSRERR_LANGUAGEMISMATCH = 'Language mismatch';
ApdStrSRERR_MULTIPLELANG = 'Multiple languages';
ApdStrSRERR_LDGRAMMARNOWORDS = 'No words in grammar';
ApdStrSRERR_NOLEXICON = 'No lexicon';
ApdStrSRERR_SPEAKEREXISTS = 'Speaker exists';
ApdStrSRERR_GRAMMARENGINEMISMATCH = 'Grammar engine mismatch';
ApdStrSRERR_BOOKMARKEXISTS = 'Bookmark exists';
ApdStrSRERR_BOOKMARKDOESNOTEXIST = 'Bookmark does not exist';
ApdStrSRERR_MICWIZARDCANCELED = 'Microphone wizard cancelled';
ApdStrSRERR_WORDTOOLONG = 'Word too long';
ApdStrSRERR_BAD_WORD = 'Bad word';
ApdStrE_WRONGTYPE = 'Wrong type';
ApdStrE_BUFFERTOOSMALL = 'Bufer too small';
ApdStrE_UNKNOWN = 'Unknown error';
{ APRO SAPI Errors }
ApdStrE_CANNOTCREATESS = 'Unable to create speech ' +
'synthesis interface';
ApdStrE_CANNOTCREATESR = 'Unable to create speech ' +
'recognition interface';
ApdStrE_CANNOTSETSPEAKER = 'Cannot set speech recognition ' +
'speaker';
ApdStrE_CANNOTSETMIC = 'Cannot set microphone';
ApdStrE_NOSAPI4 = 'SAPI 4 Engine was not found';
{ Other things }
scApdTrainGeneral = 'General Training';
scApdTrainMic = 'Microphone Training';
scApdTrainGrammar = 'Phrase Training';
const
scApdDefaultUser : string = 'APRO User';
scApdDefaultMic : string = 'Default Microphone';
scApdTelMic : string = 'Telephone';
{ Default grammars used by the TApdSapiPhone component -
These are declared as constants. It appears that if resource strings
are used, the grammars wind up truncated. }
{ DefaultPhoneGrammar - This grammar is used as a skeleton by all the
AskFor methods in the TApdSapiPhone component. It provides a basic
driver for the "ask the user for something" loop. It provides a link to
<MyGrammar> which is used to provide specific information needed for the
data being asked. }
ApdDefaultPhoneGrammar : string =
'[Grammar]' + ^M^J +
'LangId=1033' + ^M^J +
'Type=CFG' + ^M^J +
'' + ^M^J +
'[Prompts]' + ^M^J +
'; you need to modify the next few prompts' + ^M^J +
'Main=Please say something.' + ^M^J +
';Main.2=Please say the something. - Shorter prompt' + ^M^J +
'Where=You are somewhere.' + ^M^J +
'Help=This is help.' + ^M^J +
'' + ^M^J +
'VerifyPre=I heard:' + ^M^J +
'VerifyPost=Is this correct?' + ^M^J +
'Unrecognized=Sorry, I didn''t understand.' + ^M^J +
'SpeakingFaster=Speaking faster.' + ^M^J +
'SpeakingSlower=Speaking slower.' + ^M^J +
'HelpVerify=You can speak yes or no, or press 1 for yes, or 2 for no.' +
^M^J +
'' + ^M^J +
'[Settings]' + ^M^J +
'Verify=0' + ^M^J +
'; verification on grammars just respeaks the recognize string' + ^M^J +
'' + ^M^J +
'; you usually wont need to change wha''t below here' + ^M^J +
'[<Start>]' + ^M^J +
'<Start>=<AskGrammar>' + ^M^J +
'<Start>=<Verify>' + ^M^J +
'' + ^M^J +
'[<AskGrammar>]' + ^M^J +
'<AskGrammar>=<MyGrammar>' + ^M^J +
'<AskGrammar>=(DefaultResponses)' + ^M^J +
'' + ^M^J +
'; **********************************************************************' +
^M^J +
'; all controls should have these default responses' + ^M^J +
'[(DefaultResponses)]' + ^M^J +
'=[opt] (DefaultJunkBegin) (ValidDefault) [opt] (DefaultJunkEnd)' + ^M^J +
'' + ^M^J +
'[(ValidDefault)]' + ^M^J +
'-3=(AskOperator)' + ^M^J +
'-4=(AskHangUp)' + ^M^J +
'-5=(AskBack)' + ^M^J +
'-10=(AskWhere)' + ^M^J +
'-11=(AskHelp)' + ^M^J +
'-12=(AskRepeat)' + ^M^J +
'-13=(AskSpeakFaster)' + ^M^J +
'-14=(AskSpeakSlower)' + ^M^J +
'' + ^M^J +
'[(DefaultJunkBegin)]' + ^M^J +
'=could you' + ^M^J +
'=I want [opt] to' + ^M^J +
'=please' + ^M^J +
'' + ^M^J +
'[(DefaultJunkEnd)]' + ^M^J +
'=please' + ^M^J +
'=now [opt] please' + ^M^J +
'' + ^M^J +
'[(AskOperator)]' + ^M^J +
'=[opt] (TalkToOperator) (OperatorName)' + ^M^J +
'' + ^M^J +
'[(TalkToOperator)]' + ^M^J +
'=talk to' + ^M^J +
'=speak with' + ^M^J +
'=connect me to' + ^M^J +
'=give me' + ^M^J +
'' + ^M^J +
'[(OperatorName)]' + ^M^J +
'=[opt] an operator' + ^M^J +
'=someone real' + ^M^J +
'=real person' + ^M^J +
'=living person' + ^M^J +
'=warm body' + ^M^J +
'' + ^M^J +
'[(AskHangUp)]' + ^M^J +
'=hang up' + ^M^J +
'=goodbye' + ^M^J +
'' + ^M^J +
'[(AskBack)]' + ^M^J +
'=scratch that' + ^M^J +
'=go back' + ^M^J +
'=undo that' + ^M^J +
'=I made a mistake' + ^M^J +
'=never mind' + ^M^J +
'' + ^M^J +
'[(AskWhere)]' + ^M^J +
'=where am I' + ^M^J +
'=where were we' + ^M^J +
'=what am I doing' + ^M^J +
'=what''s going on' + ^M^J +
'' + ^M^J +
'[(AskHelp)]' + ^M^J +
'=[opt] some help [opt] me' + ^M^J +
'=give me help' + ^M^J +
'=what can I say' + ^M^J +
'=list [opt] voice commands' + ^M^J +
'=what are my options' + ^M^J +
'=tell me what I can say' + ^M^J +
'' + ^M^J +
'[(AskRepeat)]' + ^M^J +
'=what' + ^M^J +
'=what did you say' + ^M^J +
'=repeat [opt] that' + ^M^J +
'=huh' + ^M^J +
'' + ^M^J +
'[(AskSpeakFaster)]' + ^M^J +
'=speak faster' + ^M^J +
'=talk faster' + ^M^J +
'=speak more quickly' + ^M^J +
'=talk more quickly' + ^M^J +
'' + ^M^J +
'[(AskSpeakSlower)]' + ^M^J +
'=speak slower' + ^M^J +
'=talk slower' + ^M^J +
'=speak more slowly' + ^M^J +
'=talk more slowly' + ^M^J +
'' + ^M^J +
'; entries necessary for verification to work' + ^M^J +
'[<Verify>]' + ^M^J +
'<Verify>=(YesNo)' + ^M^J +
'<Verify>=(DefaultResponses)' + ^M^J;
{ AskForDateGrammar - This grammar provides everything needed for asking
the user for a date. }
ApdAskForDateGrammar : string =
'[<MyGrammar>]' + ^M^J +
'<MyGrammar>=(TheDate)' + ^M^J +
'' + ^M^J +
'[(TheDate)]' + ^M^J +
'-500=<Date>' + ^M^J +
'' + ^M^J +
'[<Year>]' + ^M^J +
'<Year>=<DoubleNumber>' + ^M^J +
'<Year>=<Less1000000Not>' + ^M^J +
'<Year>=<Less1000Not>' + ^M^J +
'<Year>=<Less100Not>' + ^M^J +
'// Double-number cominations, like "ninteen sixty"' + ^M^J +
'<DoubleNumber>=<Less100Not> <DoubleDigit>' + ^M^J +
'<DoubleNumber>=<Less100Not> oh "0" <1_9>' + ^M^J +
'<DoubleNumber>=<Less100Not> hundred "00"' + ^M^J +
'' + ^M^J +
'[<Month>]' + ^M^J +
'<Month>=january' + ^M^J +
'<Month>=february' + ^M^J +
'<Month>=march' + ^M^J +
'<Month>=april' + ^M^J +
'<Month>=may' + ^M^J +
'<Month>=june' + ^M^J +
'<Month>=july' + ^M^J +
'<Month>=august' + ^M^J +
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -