1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

sapi: Implement ISpeechVoice::{get/put}_Volume.

This commit is contained in:
Shaun Ren 2024-03-01 20:20:13 -05:00 committed by Alexandre Julliard
parent bf800b5e76
commit 7c384f361a
2 changed files with 21 additions and 5 deletions

View file

@ -434,7 +434,7 @@ static void test_spvoice(void)
DWORD start, duration;
ISpeechVoice *speech_voice;
ISpeechObjectTokens *speech_tokens;
LONG count;
LONG count, volume_long;
BSTR req = NULL, opt = NULL;
UINT info_count;
ITypeInfo *typeinfo;
@ -717,6 +717,13 @@ static void test_spvoice(void)
ok(count == 1, "got %ld.\n", count);
ISpeechObjectTokens_Release(speech_tokens);
volume_long = 0xdeadbeef;
hr = ISpeechVoice_put_Volume(speech_voice, 80);
ok(hr == S_OK, "got %#lx.\n", hr);
hr = ISpeechVoice_get_Volume(speech_voice, &volume_long);
ok(hr == S_OK, "got %#lx.\n", hr);
ok(volume_long == 80, "got %ld.\n", volume_long);
hr = ISpeechVoice_Speak(speech_voice, NULL, SVSFPurgeBeforeSpeak, NULL);
ok(hr == S_OK, "got %#lx.\n", hr);

View file

@ -291,16 +291,25 @@ static HRESULT WINAPI speech_voice_put_Rate(ISpeechVoice *iface, LONG rate)
static HRESULT WINAPI speech_voice_get_Volume(ISpeechVoice *iface, LONG *volume)
{
FIXME("(%p, %p): stub.\n", iface, volume);
struct speech_voice *This = impl_from_ISpeechVoice(iface);
USHORT res = 0;
HRESULT hr;
return E_NOTIMPL;
TRACE("(%p, %p).\n", iface, volume);
if (!volume) return E_POINTER;
hr = ISpVoice_GetVolume(&This->ISpVoice_iface, &res);
*volume = res;
return hr;
}
static HRESULT WINAPI speech_voice_put_Volume(ISpeechVoice *iface, LONG volume)
{
FIXME("(%p, %ld): stub.\n", iface, volume);
struct speech_voice *This = impl_from_ISpeechVoice(iface);
return E_NOTIMPL;
TRACE("(%p, %ld).\n", iface, volume);
return ISpVoice_SetVolume(&This->ISpVoice_iface, (USHORT)volume);
}
static HRESULT WINAPI speech_voice_put_AllowAudioOutputFormatChangesOnNextSet(ISpeechVoice *iface,