* Added loading config file
This commit is contained in:
Applevangelist
2023-10-17 09:28:20 +02:00
parent ab197699b6
commit 7558b7ee1d

View File

@@ -1158,10 +1158,10 @@ function MSRS:LoadConfigFile(Path,Filename,ConfigLoaded)
key = "<API Google Key>", -- for gRPC Google API key key = "<API Google Key>", -- for gRPC Google API key
--secret = "", -- needed for aws --secret = "", -- needed for aws
--region = "",-- needed for aws --region = "",-- needed for aws
defaultVoice = "MSRS.Voices.Google.Standard.en_GB_Standard_F", defaultVoice = MSRS.Voices.Google.Standard.en_GB_Standard_F,
}, },
win = { win = {
defaultVoice = "Microsoft Hazel Desktop", defaultVoice = "Hazel",
}, },
} }
} }
@@ -1514,18 +1514,20 @@ MSRS_BACKEND_DCSGRPC.Functions._DCSgRPCtts = function (self, Text, Plaintext, Fr
local provider = self.provider or self.GRPCOptions.DefaultProvider or MSRS.GRPCOptions.DefaultProvider local provider = self.provider or self.GRPCOptions.DefaultProvider or MSRS.GRPCOptions.DefaultProvider
options[provider] = {} options.provider = {}
options.provider[provider] = {}
if self.APIKey then if self.APIKey then
options[provider].key = self.APIKey options.provider[provider].key = self.APIKey
end end
if self.defaultVoice then if self.defaultVoice then
--options[provider].defaultVoice = self.defaultVoice options.provider[provider].defaultVoice = self.defaultVoice
end end
if self.voice then if self.voice then
options[provider].voice = Voice or self.voice or self.defaultVoice options.provider[provider].voice = Voice or self.voice or self.defaultVoice
elseif ssml then elseif ssml then
-- DCS-gRPC doesn't directly support language/gender, but can use SSML -- DCS-gRPC doesn't directly support language/gender, but can use SSML
-- Only use if a voice isn't explicitly set -- Only use if a voice isn't explicitly set
@@ -1551,7 +1553,7 @@ MSRS_BACKEND_DCSGRPC.Functions._DCSgRPCtts = function (self, Text, Plaintext, Fr
BASE:T("GRPC.tts") BASE:T("GRPC.tts")
BASE:T(ssml) BASE:T(ssml)
BASE:T(freq) BASE:T(freq)
BASE:T(options) BASE:T({options})
GRPC.tts(ssml, freq, options) GRPC.tts(ssml, freq, options)
end end