Compliance
Tests
1
Contents
1 Contents. 1
2 Table
of Tables. 1
3 Compliance
Testing Overview.. 3
3.1 SAPI Compliance
Required Tests 3
3.2 SAPI Compliance
Feature List Tests 3
3.3 Minimum Requirements 3
4 Using
the compliance testing tool4
5 Compliance
Tests. 5
5.1 Test Result Log:5
6 Compliance
Testing Configuration Options. 5
6.1 SAPI 5.0 Compliance
Testing Application Toolbar6
6.2 SAPI 5.0 Compliance
Testing Application Menu Choices 7
6.3 SAPI 5.0 Compliance
Testing Logging Options 9
6.4 SAPI 5.0 Compliance
Testing Run Options 10
6.5 SAPI 5.0 Compliance
Test Selection Options 11
7 SAPI
Compliance: SR.. 13
7.1 Required Tests 13
7.2 Feature Tests 23
7.3 SR Sample Engine 27
7.4 Compliance Test
Customization 29
7.5 Multilingual Support29
7.6 OS Language
Incompatibility 31
8 SAPI Compliance: TTS. 32
8.1 Required Tests 32
8.2 Feature Tests 34
8.3 TTS Sample Engine 35
8.4 Multilingual Support36
8.5 OS Language
Incompatibility 43
2
Table of Tables
Table 1: Events Compliance Test14
Table 2: Lexicon Compliance Test16
Table 3: Command and Control Compliance Test20
Table 4: Required Compliance Tests. 22
Table 5: Events Feature Compliance Test23
Table 6: Grammar Feature Compliance Test25
Table 7: Feature Compliance Tests. 26
Table 8: Sample Engine Required Compliance
Test results. 28
Table 9: Sample Engine Feature Compliance
Test results. 28
Table 10: Strings to be localized. 31
Table 12: Speak Flag Tests. 32
Table 13: Speak Tests. 33
Table 14: Lexicon Tests. 33
Table 15: SAPI XML tests. 33
Table 16: Events Tests. 34
Table 17: Sample Engine Required Test
Results. 36
Table 18: Sample Engine Feature List Test
Results. 36
Table 19: Strings to be localized for
compliance tests. 42
Table 21: Required Compliance Tests Failed. 43
Table 22: Feature Compliance Tests Not
Supported. 43
3
Compliance Testing Overview
This paper,
directed toward engine vendors, describes the SAPI 5.0 compliance testing tool
by answering the following questions:
·
What
does SAPI compliance for SAPI 5.0 imply?
·
What
are the SAPI compliance tests?
·
What
does each test look for?
3.1
SAPI Compliance
Required Tests
3.2
SAPI Compliance
Feature List Tests
The results of the
feature list tests are either "Supported" or "Unsupported". Feature list tests
were designed to help engine vendors port advanced features to SAPI 5.0. To be
SAPI compliant, the engine does not need to pass any feature list test,
although it is recommended that all features be implemented if possible.
3.3
Minimum
Requirements
The
minimum requirements for speech recognition for dictation are a 200 mhz Pentium
with 64 MB for win 95/98 or 96 MB for NT. The recommended computer is a 300 Mhz
Pentium II with 128 megs of RAM or better.
4
Using the compliance testing tool
The SAPI 5.0 compliance test tool, SPcomp.exe, enables you to load
compliance test suites and determine the test result logging options. Please
see Compliance Tests for more options.
The SPcomp.exe test tool creates the .pro file for a given test suite.
Perform compliance tests by starting the SPcomp.exe application and loading a
test suite from a .pro file. The .pro file loads the associated dynamic link
library (.dll), which contains the SR or TTS compliance tests.
To start the SAPI 5.0 compliance test tool SPcomp.exe from Windows Explorer,
double-click the compliance tool icon. Alternatively, you can perform each
compliance test from the command line by running the compliance test tool and
command line syntax.
For example, the command line syntax for running the SRcomp compliance test
in the srcompreq.pro test suite is as follows:
C:> SPcomp.exe srcompreq.pro
SPcomp.exe
srcompreq.pro
Starts the compliance test tool and
loads the speech recognition (SR) required tests from the SRcomp.dll.
SPcomp.exe srcompopt.pro
Starts the compliance test tool and
loads the speech recognition (SR) feature list tests from the SRcomp.dll.
SPcomp.exe ttscompreq.pro
Starts the compliance test tool and
loads the text-to-speech (TTS) required tests from the TTScomp.dll.
SPcomp.exe ttscompopt.pro
Starts the compliance test tool and
loads the text-to-speech (TTS) feature list tests from the TTScomp.dll.
5
Compliance Tests
The SAPI 5.0 compliance tests verify that you have successfully implemented
the required features to be considered compatible with SAPI 5.0. Your engine
must successfully complete each of the following four compliance tests with 100
percent pass rate to be compliant with SAPI 5.0.
1. srcompreq.bat
Speech Recognition (SR) required test batch file.
2. srcompopt.bat
Speech Recognition (SR) feature list test batch file.
2. ttscompreq.bat
Text-to-speech (TTS) required test batch file.
4. ttscompopt.bat
Text-to-speech (TTS) feature list test batch file.
5.1
Test Result Log:
The SAPI 5.0 compliance tool generates a result log and you can configure it
to display the result log information or you can save it to a file. The test
result log contains pass or fail state information for each segment of the test
suite. If a compliance test fails, you can review the result log to determine
the origin of the failure.
Example result log with a 100% pass rate for all tests.
Total:
=============================================================================
PASS FAIL SUPPORTED UNSUPPORTED ABORTED SKIPPED
-----------------------------------------------------------------------------
1 0 0 0 0 0
=============================================================================
Status: PASS
6
Compliance Testing Configuration Options
The SAPI 5.0 compliance test application user interface (UI) enables you to
configure the testing options. The following section provides additional
compliance test configuration information.
·
SAPI
5.0 Compliance Testing Application Toolbar
·
SAPI
5.0 Compliance Testing Application Menu Choices
·
SAPI
5.0 Compliance Testing Logging Options
·
SAPI
5.0 Compliance Testing Run Options
·
SAPI
5.0 Compliance Test Selection Options
6.1
SAPI 5.0 Compliance Testing Application Toolbar
The main window of the SAPI 5.0 compliance testing application contains a
toolbar from which you can access the configuration options. Additionally, the
configuration options are also available from the menu bar located at the top
of the compliance testing application window.
.gif)
Pause on an icon to display tooltip text. Click an icon to view the
information associated with the feature.
Load the test DLL
Loads a test dynamic-link library
(DLL).
You can run compliance tests using one of the
following methods:
1. From
the SAPI Engine Compliance Tool, click File, and then click Load Test
DLL.
2. Load
the test DLL into SPcomp.exe from the command line.
For more information, see Using
the compliance testing tool.
Note: loading a compliance test with
either method results in automatically unloading any previously loaded compliance
tests.
Load the test settings
Loads one of the pre-configured
test suites.
You can run compliance tests using one of the
following methods:
1. From
the SAPI Engine Compliance Tool, click File, and then click Load
Settings.
2. Load
the test DLL into SPcomp.exe from the command line.
For more information, see Using
the compliance testing tool.
Note: loading a compliance test with
either method results in automatically unloading any previously loaded
compliance tests.
Save settings
Saves the configuration settings
for the compliance test application.
Copy
Selects and copies content from the
display log.
Clear Window
Clears the display contents of the
result log.
Find
Searches for a specific word or
phrase within the result log.
Find Next
Searches for the next occurrence of
a specific word or phrase within the result log.
Run Test
Begins the compliance test.
Stop Test
Stops the compliance test.
Set Run Options
Configures the compliance test
options.
Select Tests
Chooses which compliance test
contained in the test suite to.
Set Logging
Determines location of the
compliance test log information.
6.2
SAPI 5.0 Compliance Testing Application Menu Choices
The SAPI 5.0 compliance testing application configuration choices are
accessible through the menu system. The following items are covered in this
section:
·
File
menu
·
Edit
menu
·
Test
menu
·
Options
menu
·
Help
menu
6.2.1
File menu
Click File to set configuration options to load settings, save
settings, or load the appropriate test DLL. Use the arrow keys to view various
menu choices. Press ENTER to select a menu choice.
.gif)
6.2.2
Edit menu
Click Edit to copy text from the result log and search for
text within the result log. Use the arrow keys to view various menu choices.
Press ENTER to select a menu choice.
.gif)
6.2.3
Test menu
Click Test to run the test or select a test. Use the arrow
keys to view various menu choices. Press ENTER to select a menu choice.
.gif)
6.2.4
Options menu
Click Options to view the various configuration settings. Use
the arrow keys to view various menu choices. Press ENTER to select a menu
choice.
.gif)
6.2.5
Help menu
Click Help and then click About to display the
SAPI 5.0 Engine Compliance Tool Version dialog box. Use the arrow keys to view
the various menu choices. Press ENTER to select a menu choice.
.gif)
6.3
SAPI 5.0 Compliance Testing Logging Options
From the Options menu, choose Logging Settings to set
SAPI 5.0 compliance test result log configuration options.
.gif)
Window
Displays the test result
information in the main window of the compliance testing application.
Log File
Saves the test result information
as text in a log file.
The log file is located at the same directory as SPcomp.exe
tool and the file name will be the following style:
spcomp@442.log
The numbers "442" in the file name are
generated by the SPcomp.exe tool and will be incremented by one each
time you restart SPcomp.exe tool and run the test. A new log file is
generated each time you start SPcomp.exe tool and run a compliance test.
Detailed
Specifies detailed result log
information.
Summary
Specifies summary result log
information.
6.4
SAPI 5.0 Compliance Testing Run Options
From the Options menu, click Run Options to configure
SAPI 5.0 compliance testing run options.
.gif)
Random
Randomizes the test order.
Close after execution
Closes the compliance testing
application after the test sequence.
Stress
This option should not be selected
for compliance tests.
Run count
Specifies the number of interactions
the selected test should run.
Disable screen saver
Disable the screen saver.
Quiet
Runs the selected test in quiet
mode.
Random Seed
The random seed value set here is
used for the next time you run the compliance test.
Note: When troubleshooting a failed
compliance test, you need to enter the same seed value information that was
used for the failed compliance test before you repeat the compliance test
procedure.
You can obtain the compliance test seed value from
the "Random Seed" field information in the SPcomp@xxx.log file that
was generated during the unsuccessful compliance test.
6.5
SAPI 5.0 Compliance Test Selection Options
From the Test menu, click Select Test to configure SAPI
5.0 compliance test choices.
.gif)
Test Cases
Displays the current test suite.
Selected Test Cases
Displays the current selected
tests.
Add Case(s)
Adds test items to the list of
selected test cases.
Alternatively, to add test cases, right-click the test case in the test case
display window and click Add Item.
.gif)
Remove Case
Removes the selected test case from
the current test. However, removing the selected test does not affect the need
to successfully pass this test case to satisfy SAPI compliancy.
Alternatively, to remove test cases, right-click
the test cases in the selected test case display window and click Remove Case.
.gif)
Remove All
Removes all test cases.
7
SAPI Compliance: SR
7.1
Required Tests
7.1.1
Events
|
Test
|
Description
|
Resource IDs
|
Description
|
|
SoundStart
|
Test will check if a sound start event occurs.
|
IDS_WAV_SOUNDSTART
|
Input .wav file,
tag_l.wav
|
|
IDR_L_GRAMMAR
|
Input CFG grammar
|
|
SoundEnd
|
Test will check if a
sound end event occurs.
|
IDS_WAV_SOUNDEND
|
Input .wav file,
tag_l.wav
|
|
IDR_L_GRAMMAR
|
Input CFG grammar
|
|
PhraseStart
|
A .wav file with audio the engine can do recognition on. Test insures that a phrase start event occurs
|
IDS_WAV_PHRASESTART
IDR_L_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
|
Recognition
|
A .wav with audio that the engine can do recognition on.
Test insures that a recognition
event occurs.
|
IDS_WAV_RECOGNITION_1
IDR_L_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
|
False Recognition
|
A wav file and a
mismatching C&C grammar are loaded. Test insures that false recognition event occurs.
|
IDS_WAV_RECOGNITION_1
IDR_RULE_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
|
SoundStart/
SoundEnd
|
Test will check that the sound
start event occurs before the sound
end event.
|
IDS_WAV_SOUNDSTARTEND
IDR_L_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
|
PhraseStart/
Recognition
|
Test will check that the
phrasestart event occurs before the recognition event.
|
IDS_WAV_RECOGNITION_1
IDR_L_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
|
SoundStart/
PhraseStart/
Recognition/
SoundEnd/
|
A wav file with audio that the engine can do recognition
on. Test insures that the audiooffsets of these events are correct
in terms of value comparison.
|
IDS_WAV_RECOGNITION_1
IDR_L_GRAMMAR
|
Input .wav file,
tag_l.wav
Input CFG grammar
|
Table 1: Events Compliance Test
7.1.2
Lexicon
7.3
SR Sample Engine
Table 8: Sample Engine Required Compliance Test
results
Table 9: Sample Engine Feature Compliance Test results
7.4 Compliance Test Customization
Many of the tests do require that a specific recognition result be returned
to verify proper handing of such things as the grammar format. To accommodate
different engines variability with recognition of different voices and to
support non-English engines, these tests will enable the engine vendor to supply
a sound file that passes the test (Refer to Section 7.5). Since some tests might share the same .wav file, it
is recommended to supply a .wav file with different name. Additionally the
grammars can be changed to accommodate words that the engine is able to
recognize better (Refer to Section 7.6).
7.5 Multilingual Support
The compliance tests will tests engines for the supported languages.
To test an SR engine that uses another language, one must:
§
Ensure that the
correct language pack is installed. For Windows 2000 and Millennium Edition,
this may be done by installing the language pack from the Windows 2000 or
Windows Millennium CD. For Windows 98 and Windows NT 4.0, install the language
pack from the Windows Update web site.
§
Select the engine
as the default engine using Speech Recognition tab in Speech properties.
§
Create and insert
a string table in the sapi5sdk\tools\comp\sr\srcomp.rc that is localized for
the language. (Refer to Table
10)
§
Create the .wav
files[4] according to the new string table and place
this under the specified directory
(according to the search path precedence (Refer to Section 7.5.2)).
§
Create and compile
the appropriate XML files using a grammar editor and complier.
§
Include the CFG
binaries into the .dll by importing the CFG file names into srcomp.rc.
§
Recompile the
sr.dsp.
§
Run the
compliance tests.
7.5.1
Example:
If you want to add resource for
test SoundStart for language 888:
1.
create and insert
copy a string table in srcomp.rc for language 888.
2.
Change the string
"IDS_WAV_SOUNDSTART" to the new
.wav file you want to use.
3.
Insert the xml
grammar file you want to use into the project. Modify the IDR_L_GRAMMAR
reference to your cfg binary.
NOTE: If the default engine supports multiple languages, then the
compliance test will only run on the first language specified in string "Language"
under key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Recognizers\Tokens\MSASREnglish\Attributes.
In other words you need to change the order of the languages in the attributes
key under your speech recognizer token for each language you wish to test.
(Refer to Section 7.6)
The strings that need to be localized are shown in Table 10.
|
|
|
|
|
IDS_RECO_L_TAG
|
put
|
Translate string
|
|
IDS_RECO_EXPRULE_TAG_1
|
play
|
Translate string
|
|
IDS_RECO_EXPRULE_TAG_2
|
the
|
Translate string
|
|
IDS_RECO_P_TAG
|
white
|
Translate string
|
|
IDS_RECO_O_TAG_1
|
please
|
Translate string
|
|
IDS_RECO_O_TAG_2
|
walk
|
Translate string
|
|
IDS_RECO_O_TAG_3
|
slowly
|
Translate string
|
|
IDS_RECO_RULE_TAG
|
seven
|
Translate string
|
|
IDS_RECO_LN_TAG
|
red
|
Translate string
|
|
IDS_RECO_NEWWORD_PRON
|
s n ao 1 r k
|
Translate phonemes
|
|
IDS_AUTOPAUSE_DYNAMICWORD1
|
put
|
Translate string
|
|
IDS_AUTOPAUSE_DYNAMICWORD2
|
red
|
Translate string
|
|
IDS_AUTOPAUSE_DYNAMICRULE1
|
Action
|
Translate string
|
|
IDS_AUTOPAUSE_DYNAMICRULE2
|
color
|
Translate string
|
|
IDS_INVALIDATETOPLEVEL_DYNAMICWORDS
|
play the oboe
|
Translate string
|
|
IDS_INVALIDATETOPLEVEL_DYNAMICRULE
|
Play
|
Translate string
|
|
IDS_INVALIDATETOPLEVEL_DYNAMICNEWWORDS
|
please play the seven
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_RULE1
|
option
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_RULE2
|
Thing
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_TOPLEVELRULE
|
play
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_OLDWORD1
|
empty
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_OLDWORD2
|
Oboe
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_NEWWORD2
|
Seven
|
Translate string
|
|
IDS_INVALIDATENONTOPLEVEL_TOPLEVELWORDS
|
Play the
|
Translate string
|
|
IDS_CFGTEXTBUFFER_WORDS
|
Play the
|
Translate string
|
|
IDS_CFGTEXTBUFFER_BUFFERWORD
|
oboe
|
Translate string
|
|
IDS_CFGTEXTBUFFER_RULE
|
play
|
Translate string
|
|
IDS_ALTERNATESCFG_BESTWORD
|
play
|
Translate string
|
|
IDS_ALTERNATESCFG_ALTERNATE1
|
played
|
Translate string
|
|
IDS_ALTERNATESCFG_ALTERNATE2
|
pay
|
Translate string
|
|
IDS_ALTERNATESCFG_WORDS
|
The oboe
|
Translate string
|
|
IDS_ALTERNATESCFG_RULE
|
play
|
Translate string
|
|
IDS_RECO_GETITNRESULT
|
please play the 7
|
Translate string
|
|
IDS_CUSTOMPROP_NEWWORD_PRON
|
s n ao 1 r k
|
Translate phonemes
|
|
IDS_CUSTOMPROP_RULE
|
play
|
Translate string
|
|
IDS_CUSTOMPROP_NEWWORD_DISP
|
abc
|
Translate string
|
|
IDS_CUSTOMPROP_NEWWORD_LEX
|
play
|
Translate string
|
|
IDS_DICTATIONTAG_WORDS
|
Play the
|
Translate string
|
|
IDS_DICTATIONTAG_RULE
|
play
|
Translate string
|
|
IDS_WILDCARD_WORDS
|
Please play
|
Translate string
|
|
IDS_WILDCARD_RULE
|
play
|
Translate string
|
|
IDS_APPLEX_PROP
|
s n ao 1 r k
|
Translate phonemes
|
|
IDS_USERLEXBEFOREAPPLEX_USERPROP
|
s n ao 1 r k
|
Translate phonemes
|
|
IDS_USERLEXBEFOREAPPLEX_APPPROP
|
P l ey
|
Translate phonemes
|
|
IDS_INVALIDATENONTOPLEVEL_NEWWORD1
|
Please
|
Translate string
|
Table 10:
Strings to be localized
7.5.2
Search Path Precedence
The compliance tests use a search path precedence to find the various .wav
files needed for the compliance tests. The order of search is:
§
current directory
§
"../resources",
§
"../../../resources"
§
"../../resources"
If the compliance tests cannot find the .wav files in these directories,
the test will pop up a dialog asking the user to enter the customized dir to
open the file. The new directory will be added to the search order and the new
search order will persist for the life of SpComp.
It is important to note that for languages that do not have a SAPI standard
phoneme set (i.e. languages which are not supported in this version of SAPI),
the engine will fail the following required compliance tests:
7.6
OS Language
Incompatibility
The compliance tests
are not based on the language of the OS. They are based on the first language
in the token of the default engine. In other words, a Japanese engine on an
English OS will cause the compliance tests to load the Japanese resources and
run the compliance tests expecting a Japanese engine. In order to run the
compliance test for an engine that has a different language than the OS, you
will need to set the default engine on the Speech Recognition tab in Speech properties.
NOTE: If the default
engine supports multiple languages, then the compliance test will only run the
first language. In other words you need to change the order of the languages in
the attributes key under your speech recognizer token for each language you
wish to test. For example, if your engine token supports both Japanese and
English, to test English, , the string "Language" must be like "409; 411" under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Recognizers\Tokens\MSASREnglish\Attributes
To test Japanese, the
string "Language" must be like "411; 409" under the same key.
8
SAPI Compliance:
TTS
SAPI compliant TTS engines must be able to
perform the following:
§
Speak with SAPI
defined speak flags
§
Return the
supported audio output formats
§
Interact with the
SAPI lexicon
§
Interpret SAPI
XML tags
§
React to
programmatic volume changes
§
React to
programmatic rate changes
§
Synthesize
certain SAPI events
§
Skip forward and
backward through a segment of text
§
Support multiple
instances
8.1
Required Tests
8.1.1
Speak
Table 12:
Speak Flag Tests
Table 13:
Speak Tests
8.1.2
Output Format
8.1.3
Lexicon
Table 14:
Lexicon Tests
8.1.4
XML Tags
Table 15:
SAPI XML tests
8.1.5
SetVolume
8.1.6
SetRate
8.1.7 Events
Table 16:
Events Tests
8.1.8
Skip
8.1.9 Multi-Instance
8.2
Feature Tests
8.3
TTS Sample Engine
Table 17:
Sample Engine Required Test Results
Table 18:
Sample Engine Feature List Test Results
8.4 Multilingual
Support
To test an engine that uses language aside for the supported languages, one
must:
§
Ensure that the
correct language pack is installed. For Windows 2000 and Millennium Edition,
this may be done by installing the language pack from the Windows 2000 or
Windows Millennium CD. For Windows 98 and Windows NT 4.0, install the language
pack from the Windows Update web site.
§
Select the engine
as the default engine using the TTS tab in Speech properties.
§
Create a string
table in the \sapi5sdk\tools\comp\tts\ttscomp.rc which is localized for the
language. (Refer to Table 19)
o Go to ResourceView in the ttscomp workspace,
right click the mouse on "String Table", and select "Insert Copy". The
following window will appear. From the window, select the language that the
engine supports, and then click OK.
.jpg)
o Open \sapi5sdk\tools\comp\tts\ttscomp.rc to
your editor and edit your language resources (Refer to Table 19), and then save
ttscomp.rc
o The following is an example how to support
GetOutputFormat test in Korean using Microsoft FrontPage editor:
§
Open ttscomp.dsw
and create a string table in Korean, save ttscomp.rc
§
Go to below table
19 and find strings used in GetOutputFormat test. Only one string, IDS_STRING65, is found corresponding to the
test.
§
Open ttscomp.rc
in Notepad and find IDS_STRING65 under Korean resources
§
Launch Microsoft
FrontPage and select File | New and Normal tab
§
Translate "This
is the TTS Compliance Test" to Korean.
§
Select Preview
tab, right click your mouse, select Encoding | Western European (Windows), and
then cut/paste the string from MS FrontPage to IDS_STRING65 under Korean
resources in your notepad
§
Save ttscomp.rc
§
Recompile the
tts.dsp.
§
Run the
compliance tests.