Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpVoice::SpeakStream

ISpVoice::SpeakStream speaks the contents of a stream.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SpeakStream(</strong> <strong> IStream</strong> *<em>pStream</em>, <strong> DWORD</strong> <em>dwFlags</em>, <strong> ULONG</strong> *<em>pulStreamNumber</em> <strong>);</strong> </pre>

Parameters

  • pStream
    [in] Address of an IStream interface containing the input stream. If the ISpStreamFormat interface is not implemented by the input stream, the format type is assumed to be SPDFID_Text.
  • dwFlags
    [in] Flags used to control the rendering process for this call. The flag values are contained in the SPEAKFLAGS enumeration, however the SPF_IS_FILENAME flag is not used for SpeakStream.
  • pulStreamNumber
    [out] Pointer to a ULONG which receives the current input stream number associated with this SpeakStream request. Each time a string is spoken, an associated stream number is returned. Events queued back to the application related to this string will contain this number.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more parameters are invalid.
E_POINTER Invalid pointer.
E_OUTOFMEMORY Exceeded available memory.
SPERR_INVALID_FLAGS Invalid flags specified for this operation.
SPERR_DEVICE_BUSY Timeout on synchronous call.

Remarks

If the input stream is wave data, it is sent directly to the output object. For more information about connecting an input stream to a voice, see ISpStream::BindToFile.

If the input stream is text data, it is processed by the text-to-speech engine.

Normally, pulStreamNumber will just be 1. If, however, several asynchronous SpeakStream (or Speak) calls are received and must be queued, the stream number will be incremented for each call.