This commit is contained in:
Applevangelist 2024-01-09 08:58:07 +01:00
parent e26647c2ca
commit b315375ade

View File

@ -1495,13 +1495,13 @@ end
-- @return #PLAYERRECCE self -- @return #PLAYERRECCE self
function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey) function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey)
self:T(self.lid.."SetSRS") self:T(self.lid.."SetSRS")
self.PathToSRS = PathToSRS or "C:\\Program Files\\DCS-SimpleRadio-Standalone" -- self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone" --
self.Gender = Gender or "male" -- self.Gender = Gender or MSRS.gender or "male" --
self.Culture = Culture or "en-US" -- self.Culture = Culture or MSRS.culture or "en-US" --
self.Port = Port or 5002 -- self.Port = Port or MSRS.port or 5002 --
self.Voice = Voice -- self.Voice = Voice or MSRS.voice --
self.PathToGoogleKey = PathToGoogleKey -- self.PathToGoogleKey = PathToGoogleKey --
self.Volume = Volume or 1.0 -- self.Volume = Volume or 1.0 --
self.UseSRS = true self.UseSRS = true
self.Frequency = Frequency or {127,251} -- self.Frequency = Frequency or {127,251} --
self.BCFrequency = self.Frequency self.BCFrequency = self.Frequency
@ -1514,17 +1514,17 @@ function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,V
self.SRS:SetGender(self.Gender) self.SRS:SetGender(self.Gender)
self.SRS:SetCulture(self.Culture) self.SRS:SetCulture(self.Culture)
self.SRS:SetPort(self.Port) self.SRS:SetPort(self.Port)
self.SRS:SetVoice(self.Voice)
self.SRS:SetVolume(self.Volume) self.SRS:SetVolume(self.Volume)
if self.PathToGoogleKey then if self.PathToGoogleKey then
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.PathToGoogleKey) self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.PathToGoogleKey)
self.SRS:SetProvider(MSRS.Provider.GOOGLE) self.SRS:SetProvider(MSRS.Provider.GOOGLE)
end end
-- Pre-configured Google? -- Pre-configured Google?
if (not PathToGoogleKey) and self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then if (not PathToGoogleKey) and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
self.PathToGoogleKey = MSRS.poptions.gcloud.credentials self.PathToGoogleKey = MSRS.poptions.gcloud.credentials
self.Voice = Voice or MSRS.poptions.gcloud.voice self.Voice = Voice or MSRS.poptions.gcloud.voice
end end
self.SRS:SetVoice(self.Voice)
self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name) self.SRSQueue = MSRSQUEUE:New(self.MenuName or self.Name)
self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers) self.SRSQueue:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
return self return self