Share via


ISpRecoResult::SpeakAudio

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

This method gets and speaks the specified audio. This combines two other methods, first calling ISpRecoResult::GetAudio and then ISpVoice::SpeakStream on the parent recognition context.

If the application did not start retained audio (see ISpRecoContext::SetAudioOptions), or make a previous call to ISpPhrase::Discard and eliminate the retained audio, then this method will fail with SPERR_NO_AUDIO_DATA.

Syntax

HRESULT SpeakAudio(
  ULONG ulStartElement,
  ULONG cElements,
  DWORD dwFlags, 
  ULONG* pulStreamNumber
);

Parameters

  • ulStartElement
    [in] Element with which to start.
  • cElements
    [in] Number of elements contained in the stream. A value of zero speaks all elements.
  • dwFlags
    [in] Attributes of the text stream. Possible values are defined for the SPEAKFLAGS enumeration.
  • pulStreamNumber
    [out, optional] Pointer to stream number information, or to NULL if no stream number is retrieved.

Return Value

The following table shows the possible return values. Return values can also be those from ISpVoice::SpeakStream.

Value Description

S_OK

Function completed successfully.

SPERR_NO_AUDIO_DATA

Result does not contain audio data.

E_POINTER

pulStreamNumber is a non-null, bad pointer.

FAILED(hr)

Appropriate error message.

Requirements

Header sapi.h, sapi.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpRecoResult
SAPI Interfaces