Note
Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.
Microsoft Speech Platform
ISpTranscript::AppendTranscript
ISpTranscript::AppendTranscript adds the current text to the transcript.
<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT AppendTranscript(</strong> <strong> LPCWSTR</strong> *<em>pszTranscript</em> <strong>);</strong> </pre>
Parameters
- pszTranscript
[in, string] The text of the transcript. If pszTranscript is NULL, the current transcript is deleted. Otherwise, the text is appended to the current transcript.
Return Values
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_INVALIDARG | pszTranscript is bad or not valid. |
E_OUTOFMEMORY | Exceeded available memory. |
FAILED (hr) | Appropriate error message. |
Example
The following code snippet illustrates the use of ISpTranscript::AppendTranscript.
`
// Declare local identifiers: HRESULT hr = S_OK; CComPtr<ISpStream> cpStream; CComPtr<ISpTranscript> cpTranscript;`// Bind a stream to an existing wavefile (assumes // existence of the file "C:\VoiceToFile.wav"). hr = SPBindToFile(L"C:\VoiceToFile.wav", SPFM_CREATE_ALWAYS, &cpStream;);
if (SUCCEEDED(hr)) { hr = cpStream.QueryInterface(&cpTranscript;); }
if (SUCCEEDED(hr)) { hr = cpTranscript->AppendTranscript(L"this is a test"); }
if (SUCCEEDED(hr)) { // Do stuff here. }