Skip to content

Commit

Permalink
sapi: Implement ISpeechVoice::Speak.
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunren authored and julliard committed Feb 20, 2024
1 parent afac7d7 commit 5243f2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions dlls/sapi/tests/tts.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ static void test_spvoice(void)
ULONG stream_num;
DWORD regid;
DWORD start, duration;
ISpeechVoice *speech_voice;
HRESULT hr;

if (waveOutGetNumDevs() == 0) {
Expand Down Expand Up @@ -681,6 +682,14 @@ static void test_spvoice(void)
ok(hr == S_OK, "got %#lx.\n", hr);
ok(duration < 300, "took %lu ms.\n", duration);

hr = ISpVoice_QueryInterface(voice, &IID_ISpeechVoice, (void **)&speech_voice);
ok(hr == S_OK, "got %#lx.\n", hr);

hr = ISpeechVoice_Speak(speech_voice, NULL, SVSFPurgeBeforeSpeak, NULL);
ok(hr == S_OK, "got %#lx.\n", hr);

ISpeechVoice_Release(speech_voice);

done:
reset_engine_params(&test_engine);
ISpVoice_Release(voice);
Expand Down
6 changes: 4 additions & 2 deletions dlls/sapi/tts.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,11 @@ static HRESULT WINAPI speech_voice_get_SynchronousSpeakTimeout(ISpeechVoice *ifa

static HRESULT WINAPI speech_voice_Speak(ISpeechVoice *iface, BSTR text, SpeechVoiceSpeakFlags flags, LONG *number)
{
FIXME("(%p, %s, %#x, %p): stub.\n", iface, debugstr_w(text), flags, number);
struct speech_voice *This = impl_from_ISpeechVoice(iface);

return E_NOTIMPL;
TRACE("(%p, %s, %#x, %p).\n", iface, debugstr_w(text), flags, number);

return ISpVoice_Speak(&This->ISpVoice_iface, text, flags, (ULONG *)number);
}

static HRESULT WINAPI speech_voice_SpeakStream(ISpeechVoice *iface, ISpeechBaseStream *stream,
Expand Down

0 comments on commit 5243f2e

Please sign in to comment.