Skip to content

Commit 5243f2e

Browse files
shaunrenjulliard
authored andcommitted
sapi: Implement ISpeechVoice::Speak.
1 parent afac7d7 commit 5243f2e

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

dlls/sapi/tests/tts.c

+9
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ static void test_spvoice(void)
431431
ULONG stream_num;
432432
DWORD regid;
433433
DWORD start, duration;
434+
ISpeechVoice *speech_voice;
434435
HRESULT hr;
435436

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

685+
hr = ISpVoice_QueryInterface(voice, &IID_ISpeechVoice, (void **)&speech_voice);
686+
ok(hr == S_OK, "got %#lx.\n", hr);
687+
688+
hr = ISpeechVoice_Speak(speech_voice, NULL, SVSFPurgeBeforeSpeak, NULL);
689+
ok(hr == S_OK, "got %#lx.\n", hr);
690+
691+
ISpeechVoice_Release(speech_voice);
692+
684693
done:
685694
reset_engine_params(&test_engine);
686695
ISpVoice_Release(voice);

dlls/sapi/tts.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,11 @@ static HRESULT WINAPI speech_voice_get_SynchronousSpeakTimeout(ISpeechVoice *ifa
357357

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

362-
return E_NOTIMPL;
362+
TRACE("(%p, %s, %#x, %p).\n", iface, debugstr_w(text), flags, number);
363+
364+
return ISpVoice_Speak(&This->ISpVoice_iface, text, flags, (ULONG *)number);
363365
}
364366

365367
static HRESULT WINAPI speech_voice_SpeakStream(ISpeechVoice *iface, ISpeechBaseStream *stream,

0 commit comments

Comments
 (0)