ISpVoice::Speak
This method speaks a string or a text file, which is the main operation of the ISpVoice interface.
HRESULT Speak(
const WCHAR* pwcs,
DWORD dwFlags,
ULONG* pulStreamNumber
);
Parameters
- pwcs
[in] Pointer to a null-terminated string (possibly containing XML markup) to be synthesized. This value can be NULL when dwFlags is set to SPF_PURGEBEFORESPEAK indicating that any remaining data to be synthesized should be discarded. If dwFlags is set to SPF_IS_FILENAME, this value should point to a null-terminated, fully qualified path to a file. - dwFlags
[in] Flags used to control the rendering process for this call. Possible values are defined by the SPEAKFLAGS enumeration. - pulStreamNumber
[out] Pointer to the current input stream number associated with this speak request. Each time a string is spoken, an associated stream number is retrieved. Events queued back to the application related to this string will contain this number.
Return Values
The following table shows the possible return values.
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | One or more arguments are invalid. |
E_POINTER | Invalid pointer. |
E_OUTOFMEMORY | Exceeded available memory. |
SPERR_INVALID_FLAGS | Invalid flags specified for this operation. |
SPERR_DEVICE_BUSY | Timeout occurred on synchronous call. |
Remarks
Typically, pulStreamNumber will be 1. However, if several asynchronous Speak (or SpeakStream) calls are received and must be queued, the stream number will be incremented for each call.
Requirements
OS Versions: Windows CE .NET 4.1 and later.
Header: Sapi.h, Sapi.idl.
Link Library: Sapilib.lib.
See Also
Last updated on Saturday, April 10, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.