Skip to content

Commit d4bc5ca

Browse files
committed
Wine-related error when SAPI isn't installed
1 parent 9c0b2ca commit d4bc5ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sapi_interface.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ require "luacom"
2828
-- Instantiate a SAPI voice obejct
2929
local engine = luacom.CreateObject("SAPI.SpVoice")
3030

31-
if not engine then
31+
if not (engine and engine.GetVoices) then
3232
return -1
3333
end
3434

3535
local NUM_SAPI_VOICES = engine:GetVoices().Count
3636

37+
if NUM_SAPI_VOICES == nil then
38+
return -1 -- Probably in Wine without SAPI support installed
39+
end
40+
3741
if NUM_SAPI_VOICES == 0 then
3842
return -2
3943
end

0 commit comments

Comments
 (0)