<s>
The	O
Speech	B-Application
Application	I-Application
Programming	I-Application
Interface	I-Application
or	O
SAPI	O
is	O
an	O
API	B-Application
developed	O
by	O
Microsoft	O
to	O
allow	O
the	O
use	O
of	O
speech	B-Application
recognition	I-Application
and	O
speech	B-Application
synthesis	I-Application
within	O
Windows	B-Application
applications	I-Application
.	O
</s>
<s>
To	O
date	O
,	O
a	O
number	O
of	O
versions	O
of	O
the	O
API	B-Application
have	O
been	O
released	O
,	O
which	O
have	O
shipped	O
either	O
as	O
part	O
of	O
a	O
Speech	O
SDK	B-Application
or	O
as	O
part	O
of	O
the	O
Windows	B-Application
OS	I-Application
itself	O
.	O
</s>
<s>
Applications	O
that	O
use	O
SAPI	O
include	O
Microsoft	B-Application
Office	I-Application
,	O
Microsoft	B-Application
Agent	I-Application
and	O
Microsoft	B-Application
Speech	I-Application
Server	I-Application
.	O
</s>
<s>
In	O
general	O
,	O
all	O
versions	O
of	O
the	O
API	B-Application
have	O
been	O
designed	O
such	O
that	O
a	O
software	O
developer	O
can	O
write	O
an	O
application	O
to	O
perform	O
speech	B-Application
recognition	I-Application
and	O
synthesis	O
by	O
using	O
a	O
standard	O
set	O
of	O
interfaces	O
,	O
accessible	O
from	O
a	O
variety	O
of	O
programming	O
languages	O
.	O
</s>
<s>
In	O
addition	O
,	O
it	O
is	O
possible	O
for	O
a	O
3rd-party	O
company	O
to	O
produce	O
their	O
own	O
Speech	B-Application
Recognition	I-Application
and	O
Text-To-Speech	B-Application
engines	O
or	O
adapt	O
existing	O
engines	O
to	O
work	O
with	O
SAPI	O
.	O
</s>
<s>
In	O
general	O
,	O
the	O
Speech	O
API	B-Application
is	O
a	O
freely	O
redistributable	O
component	O
which	O
can	O
be	O
shipped	O
with	O
any	O
Windows	B-Application
application	O
that	O
wishes	O
to	O
use	O
speech	O
technology	O
.	O
</s>
<s>
Many	O
versions	O
(	O
although	O
not	O
all	O
)	O
of	O
the	O
speech	B-Application
recognition	I-Application
and	O
synthesis	O
engines	O
are	O
also	O
freely	O
redistributable	O
.	O
</s>
<s>
There	O
have	O
been	O
two	O
main	O
'	O
families	O
 '	O
of	O
the	O
Microsoft	B-Application
Speech	I-Application
API	I-Application
.	O
</s>
<s>
SAPI	B-Application
5	I-Application
,	O
however	O
,	O
was	O
a	O
completely	O
new	O
interface	O
,	O
released	O
in	O
2000	O
.	O
</s>
<s>
Since	O
then	O
several	O
sub-versions	O
of	O
this	O
API	B-Application
have	O
been	O
released	O
.	O
</s>
<s>
The	O
Speech	O
API	B-Application
can	O
be	O
viewed	O
as	O
an	O
interface	O
or	O
piece	O
of	O
middleware	O
which	O
sits	O
between	O
applications	O
and	O
speech	O
engines	O
(	O
recognition	O
and	O
synthesis	O
)	O
.	O
</s>
<s>
The	O
API	B-Application
included	O
an	O
abstract	O
interface	O
definition	O
which	O
applications	O
and	O
engines	O
conformed	O
to	O
.	O
</s>
<s>
In	O
SAPI	B-Application
5	I-Application
however	O
,	O
applications	O
and	O
engines	O
do	O
not	O
directly	O
communicate	O
with	O
each	O
other	O
.	O
</s>
<s>
Instead	O
,	O
each	O
talks	O
to	O
a	O
runtime	B-Device
component	O
(	O
sapi.dll	O
)	O
.	O
</s>
<s>
There	O
is	O
an	O
API	B-Application
implemented	O
by	O
this	O
component	O
which	O
applications	O
use	O
,	O
and	O
another	O
set	O
of	O
interfaces	O
for	O
engines	O
.	O
</s>
<s>
Typically	O
in	O
SAPI	B-Application
5	I-Application
applications	O
issue	O
calls	O
through	O
the	O
API	B-Application
(	O
for	O
example	O
to	O
load	O
a	O
recognition	O
grammar	O
;	O
start	O
recognition	O
;	O
or	O
provide	O
text	O
to	O
be	O
synthesized	O
)	O
.	O
</s>
<s>
The	O
sapi.dll	O
runtime	B-Device
component	O
interprets	O
these	O
commands	O
and	O
processes	O
them	O
,	O
where	O
necessary	O
calling	O
on	O
the	O
engine	O
through	O
the	O
engine	O
interfaces	O
(	O
for	O
example	O
,	O
the	O
loading	O
of	O
grammar	O
from	O
a	O
file	O
is	O
done	O
in	O
the	O
runtime	B-Device
,	O
but	O
then	O
the	O
grammar	O
data	O
is	O
passed	O
to	O
the	O
recognition	O
engine	O
to	O
actually	O
use	O
in	O
recognition	O
)	O
.	O
</s>
<s>
The	O
recognition	O
and	O
synthesis	O
engines	O
also	O
generate	O
events	O
while	O
processing	O
(	O
for	O
example	O
,	O
to	O
indicate	O
an	O
utterance	O
has	O
been	O
recognized	O
or	O
to	O
indicate	O
word	O
boundaries	O
in	O
the	O
synthesized	B-Application
speech	I-Application
)	O
.	O
</s>
<s>
These	O
pass	O
in	O
the	O
reverse	O
direction	O
,	O
from	O
the	O
engines	O
,	O
through	O
the	O
runtime	B-Device
DLL	O
,	O
and	O
on	O
to	O
an	O
event	O
sink	O
in	O
the	O
application	O
.	O
</s>
<s>
In	O
addition	O
to	O
the	O
actual	O
API	B-Application
definition	O
and	O
runtime	B-Device
DLL	O
,	O
other	O
components	O
are	O
shipped	O
with	O
all	O
versions	O
of	O
SAPI	O
to	O
make	O
a	O
complete	O
Speech	O
Software	B-Application
Development	I-Application
Kit	I-Application
.	O
</s>
<s>
The	O
following	O
components	O
are	O
among	O
those	O
included	O
in	O
most	O
versions	O
of	O
the	O
Speech	O
SDK	B-Application
:	O
</s>
<s>
API	B-Application
definition	O
files	O
-	O
in	O
MIDL	B-Application
and	O
as	O
C	O
or	O
C++	B-Language
header	O
files	O
.	O
</s>
<s>
Runtime	B-Device
components	O
-	O
e.g.	O
</s>
<s>
Control	O
Panel	O
applet	O
-	O
to	O
select	O
and	O
configure	O
default	O
speech	B-Application
recognizer	I-Application
and	O
synthesizer	O
.	O
</s>
<s>
Text-To-Speech	B-Application
engines	O
in	O
multiple	O
languages	O
.	O
</s>
<s>
Speech	B-Application
Recognition	I-Application
engines	O
in	O
multiple	O
languages	O
.	O
</s>
<s>
Redistributable	O
components	O
to	O
allow	O
developers	O
to	O
package	O
the	O
engines	O
and	O
runtime	B-Device
with	O
their	O
application	O
code	O
to	O
produce	O
a	O
single	O
installable	O
application	O
.	O
</s>
<s>
The	O
first	O
version	O
of	O
SAPI	O
was	O
released	O
in	O
1995	O
,	O
and	O
was	O
supported	O
on	O
Windows	B-Application
95	I-Application
and	O
Windows	B-Device
NT	I-Device
3.51	I-Device
.	O
</s>
<s>
This	O
version	O
included	O
low-level	O
Direct	O
Speech	B-Application
Recognition	I-Application
and	O
Direct	O
Text	B-Application
To	I-Application
Speech	I-Application
APIs	B-Application
which	O
applications	O
could	O
use	O
to	O
directly	O
control	O
engines	O
,	O
as	O
well	O
as	O
simplified	O
'	O
higher-level	O
'	O
Voice	B-Application
Command	I-Application
and	O
Voice	O
Talk	O
APIs	B-Application
.	O
</s>
<s>
It	O
added	O
limited	O
support	O
for	O
dictation	O
speech	B-Application
recognition	I-Application
(	O
discrete	O
speech	O
,	O
not	O
continuous	O
)	O
,	O
and	O
additional	O
sample	O
applications	O
and	O
audio	O
sources	O
.	O
</s>
<s>
This	O
version	O
of	O
SAPI	O
included	O
both	O
the	O
core	O
COM	B-Application
API	B-Application
;	O
together	O
with	O
C++	B-Language
wrapper	O
classes	O
to	O
make	O
programming	O
from	O
C++	B-Language
easier	O
;	O
and	O
ActiveX	B-Application
controls	I-Application
to	O
allow	O
drag-and-drop	O
Visual	B-Language
Basic	I-Language
development	O
.	O
</s>
<s>
This	O
was	O
shipped	O
as	O
part	O
of	O
an	O
SDK	B-Application
that	O
included	O
recognition	O
and	O
synthesis	O
engines	O
.	O
</s>
<s>
It	O
also	O
shipped	O
(	O
with	O
synthesis	O
engines	O
only	O
)	O
in	O
Windows	B-Application
2000	I-Application
.	O
</s>
<s>
The	O
main	O
components	O
of	O
the	O
SAPI	B-Application
4	I-Application
API	B-Application
(	O
which	O
were	O
all	O
available	O
in	O
C++	B-Language
,	O
COM	B-Application
,	O
and	O
ActiveX	B-Application
flavors	O
)	O
were	O
:	O
</s>
<s>
The	O
Speech	O
SDK	B-Application
version	O
5.0	O
,	O
incorporating	O
the	O
SAPI	O
5.0	O
runtime	B-Device
was	O
released	O
in	O
2000	O
.	O
</s>
<s>
The	O
design	O
of	O
the	O
new	O
API	B-Application
included	O
the	O
concept	O
of	O
strictly	O
separating	O
the	O
application	O
and	O
engine	O
so	O
all	O
calls	O
were	O
routed	O
through	O
the	O
runtime	B-Device
sapi.dll	O
.	O
</s>
<s>
This	O
change	O
was	O
intended	O
to	O
make	O
the	O
API	B-Application
more	O
'	O
engine-independent	O
'	O
,	O
preventing	O
applications	O
from	O
inadvertently	O
depending	O
on	O
features	O
of	O
a	O
specific	O
engine	O
.	O
</s>
<s>
In	O
addition	O
,	O
this	O
change	O
was	O
aimed	O
at	O
making	O
it	O
much	O
easier	O
to	O
incorporate	O
speech	O
technology	O
into	O
an	O
application	O
by	O
moving	O
some	O
management	O
and	O
initialization	O
code	O
into	O
the	O
runtime	B-Device
.	O
</s>
<s>
The	O
new	O
API	B-Application
was	O
initially	O
a	O
pure	O
COM	B-Application
API	B-Application
and	O
could	O
be	O
used	O
easily	O
only	O
from	O
C/C	O
++	O
.	O
</s>
<s>
Operating	B-General_Concept
systems	I-General_Concept
from	O
Windows	B-Device
98	I-Device
and	O
NT	B-Device
4.0	I-Device
upwards	O
were	O
supported	O
.	O
</s>
<s>
Major	O
features	O
of	O
the	O
API	B-Application
include	O
:	O
</s>
<s>
For	O
desktop	O
speech	B-Application
recognition	I-Application
applications	O
,	O
a	O
recognizer	O
object	O
can	O
be	O
used	O
that	O
runs	O
in	O
a	O
separate	O
process	O
(	O
sapisvr.exe	O
)	O
.	O
</s>
<s>
SAPI	B-Application
5	I-Application
defines	O
an	O
XML	B-Protocol
markup	O
for	O
specifying	O
a	O
grammar	O
,	O
as	O
well	O
as	O
mechanisms	O
to	O
create	O
them	O
dynamically	O
in	O
code	O
.	O
</s>
<s>
This	O
performs	O
speech	B-Application
synthesis	I-Application
,	O
producing	O
an	O
audio	O
stream	O
from	O
a	O
text	O
.	O
</s>
<s>
A	O
markup	O
language	O
(	O
similar	O
to	O
XML	B-Protocol
,	O
but	O
not	O
strictly	O
XML	B-Protocol
)	O
can	O
be	O
used	O
for	O
controlling	O
the	O
synthesis	O
process	O
.	O
</s>
<s>
The	O
runtime	B-Device
includes	O
objects	O
for	O
performing	O
speech	O
input	O
from	O
the	O
microphone	O
or	O
speech	O
output	O
to	O
speakers	O
(	O
or	O
any	O
sound	O
device	O
)	O
;	O
as	O
well	O
as	O
to	O
and	O
from	O
wave	O
files	O
.	O
</s>
<s>
This	O
version	O
shipped	O
in	O
late	O
2000	O
as	O
part	O
of	O
the	O
Speech	O
SDK	B-Application
version	O
5.0	O
,	O
together	O
with	O
version	O
5.0	O
recognition	O
and	O
synthesis	O
engines	O
.	O
</s>
<s>
This	O
version	O
of	O
the	O
API	B-Application
and	O
recognition	O
engines	O
also	O
shipped	O
in	O
Microsoft	B-Application
Office	I-Application
XP	B-Application
in	O
2001	O
.	O
</s>
<s>
This	O
version	O
shipped	O
in	O
late	O
2001	O
as	O
part	O
of	O
the	O
Speech	O
SDK	B-Application
version	O
5.1	O
.	O
</s>
<s>
Automation-compliant	O
interfaces	O
were	O
added	O
to	O
the	O
API	B-Application
to	O
allow	O
use	O
from	O
Visual	B-Language
Basic	I-Language
,	O
scripting	O
languages	O
such	O
as	O
JScript	B-Language
,	O
and	O
managed	O
code	O
.	O
</s>
<s>
This	O
version	O
of	O
the	O
API	B-Application
and	O
TTS	O
engines	O
were	O
shipped	O
in	O
Windows	B-Application
XP	I-Application
.	O
</s>
<s>
Windows	B-Application
XP	I-Application
Tablet	O
PC	O
Edition	O
and	O
Office	O
2003	O
also	O
include	O
this	O
version	O
but	O
with	O
a	O
substantially	O
improved	O
version	O
6	O
recognition	O
engine	O
and	O
Traditional	O
Chinese	O
.	O
</s>
<s>
This	O
was	O
a	O
special	O
version	O
of	O
the	O
API	B-Application
for	O
use	O
only	O
in	O
the	O
Microsoft	B-Application
Speech	I-Application
Server	I-Application
which	O
shipped	O
in	O
2004	O
.	O
</s>
<s>
It	O
added	O
support	O
for	O
SRGS	O
and	O
SSML	B-Application
mark-up	O
languages	O
,	O
as	O
well	O
as	O
additional	O
server	O
features	O
and	O
performance	O
improvements	O
.	O
</s>
<s>
This	O
is	O
the	O
version	O
of	O
the	O
API	B-Application
that	O
ships	O
in	O
Windows	B-Application
Vista	I-Application
together	O
with	O
new	O
recognition	O
and	O
synthesis	O
engines	O
.	O
</s>
<s>
As	O
Windows	B-General_Concept
Speech	I-General_Concept
Recognition	I-General_Concept
is	O
now	O
integrated	O
into	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
the	O
Speech	O
SDK	B-Application
and	O
APIs	B-Application
are	O
a	O
part	O
of	O
the	O
Windows	B-Application
SDK	I-Application
.	O
</s>
<s>
Support	O
for	O
W3C	O
XML	B-Protocol
speech	O
grammars	O
for	O
recognition	O
and	O
synthesis	O
.	O
</s>
<s>
The	O
Speech	B-Application
Synthesis	I-Application
Markup	I-Application
Language	I-Application
(	O
SSML	B-Application
)	O
version	O
1.0	O
provides	O
the	O
ability	O
to	O
mark	O
up	O
voice	O
characteristics	O
,	O
speed	O
,	O
volume	O
,	O
pitch	O
,	O
emphasis	O
,	O
and	O
pronunciation	O
.	O
</s>
<s>
The	O
Speech	B-Application
Recognition	I-Application
Grammar	O
Specification	O
(	O
SRGS	O
)	O
supports	O
the	O
definition	O
of	O
context-free	O
grammars	O
,	O
with	O
two	O
limitations	O
:	O
</s>
<s>
SAPI	O
5.3	O
enables	O
an	O
SRGS	O
grammar	O
to	O
be	O
annotated	O
with	O
JavaScript	B-Language
for	O
semantic	O
interpretation	O
to	O
supplement	O
the	O
recognized	O
text	O
.	O
</s>
<s>
This	O
is	O
an	O
updated	O
version	O
of	O
the	O
API	B-Application
that	O
ships	O
in	O
Windows	B-Device
7	I-Device
.	O
</s>
<s>
Microsoft	B-Application
Sam	I-Application
(	O
Speech	O
Articulation	O
Module	O
)	O
is	O
a	O
commonly	O
shipped	O
SAPI	B-Application
5	I-Application
voice	O
.	O
</s>
<s>
In	O
addition	O
,	O
Microsoft	B-Application
Office	I-Application
XP	B-Application
and	O
Office	O
2003	O
installed	O
L&H	O
Michael	O
and	O
Michelle	O
voices	O
.	O
</s>
<s>
The	O
SAPI	O
5.1	O
SDK	B-Application
installs	O
2	O
more	O
voices	O
,	O
Mike	O
and	O
Mary	O
.	O
</s>
<s>
Windows	B-Application
Vista	I-Application
includes	O
Microsoft	B-Application
Anna	I-Application
which	O
replaces	O
Microsoft	B-Application
Sam	I-Application
and	O
sounds	O
more	O
natural	O
and	O
intelligible	O
.	O
</s>
<s>
It	O
is	O
also	O
installed	O
on	O
Windows	B-Application
XP	I-Application
by	O
Microsoft	B-Application
Streets	I-Application
&	I-Application
Trips	I-Application
2006	O
and	O
later	O
versions	O
.	O
</s>
<s>
The	O
Chinese	O
version	O
of	O
Vista	B-Application
and	O
later	O
Windows	B-Application
client	O
versions	O
also	O
include	O
a	O
female	O
voice	O
named	O
Microsoft	B-Application
Lili	I-Application
.	O
</s>
<s>
A	O
managed	O
code	O
API	B-Application
ships	O
as	O
part	O
of	O
the	O
.NET	O
Framework	O
3.0	O
.	O
</s>
<s>
It	O
has	O
similar	O
functionality	O
to	O
SAPI	B-Application
5	I-Application
but	O
is	O
more	O
suitable	O
to	O
be	O
used	O
by	O
managed	O
code	O
applications	O
.	O
</s>
<s>
The	O
new	O
API	B-Application
is	O
available	O
on	O
Windows	B-Application
XP	I-Application
,	O
Windows	B-Application
Server	I-Application
2003	I-Application
,	O
Windows	B-Application
Vista	I-Application
,	O
and	O
Windows	B-Device
Server	I-Device
2008	I-Device
.	O
</s>
<s>
The	O
existing	O
SAPI	B-Application
5	I-Application
API	B-Application
can	O
also	O
be	O
used	O
from	O
managed	O
code	O
to	O
a	O
limited	O
extent	O
by	O
creating	O
a	O
COM	B-Application
Interop	O
code	O
(	O
helper	O
code	O
designed	O
to	O
assist	O
in	O
accessing	O
COM	B-Application
interfaces	O
and	O
classes	O
)	O
.	O
</s>
<s>
This	O
works	O
well	O
in	O
some	O
scenarios	O
however	O
the	O
new	O
API	B-Application
should	O
provide	O
a	O
more	O
seamless	O
experience	O
equivalent	O
to	O
using	O
any	O
other	O
managed	O
code	O
library	O
.	O
</s>
<s>
However	O
,	O
major	O
obstacle	O
towards	O
transitioning	O
from	O
the	O
COM	B-Application
Interop	O
is	O
the	O
fact	O
that	O
the	O
managed	O
implementation	O
has	O
subtle	O
memory	B-Error_Name
leaks	I-Error_Name
which	O
lead	O
to	O
memory	O
fragmentation	O
and	O
exclude	O
the	O
use	O
of	O
the	O
library	O
in	O
any	O
non-trivial	O
applications	O
.	O
</s>
<s>
As	O
a	O
workaround	O
,	O
Microsoft	O
has	O
suggested	O
using	O
a	O
different	O
API	B-Application
,	O
which	O
has	O
fewer	O
voices	O
.	O
</s>
<s>
Windows	B-Application
Vista	I-Application
includes	O
a	O
number	O
of	O
new	O
speech-related	O
features	O
including	O
:	O
</s>
<s>
Speech	B-Application
recognition	I-Application
support	O
for	O
8	O
languages	O
at	O
release	O
time	O
:	O
U.S.	O
English	O
,	O
U.K.	O
English	O
,	O
traditional	O
Chinese	O
,	O
simplified	O
Chinese	O
,	O
Japanese	O
,	O
Spanish	O
,	O
French	O
,	O
and	O
German	O
,	O
with	O
more	O
language	O
to	O
be	O
released	O
later	O
.	O
</s>
<s>
Microsoft	B-Application
Agent	I-Application
most	O
notably	O
,	O
and	O
all	O
other	O
Microsoft	O
speech	O
applications	O
use	O
SAPI	B-Application
5	I-Application
.	O
</s>
<s>
The	O
Speech	O
API	B-Application
is	O
compatible	O
with	O
the	O
following	O
operating	B-General_Concept
systems	I-General_Concept
:	O
</s>
<s>
Microsoft	B-Device
Windows	I-Device
NT	I-Device
4.0	I-Device
,	O
Service	O
Pack	O
6a	O
,	O
in	O
English	O
,	O
Japanese	O
and	O
Simplified	O
Chinese	O
.	O
</s>
