From 65315251b5f3db591a8e8c6a41b345111b7e98c2 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 5 Jan 2024 12:13:04 +0100 Subject: [PATCH] PLAYERTASK, AWACS - small fix for the revamped SRS --- Moose Development/Moose/Ops/Awacs.lua | 22 ++++++++++++++-------- Moose Development/Moose/Ops/PlayerTask.lua | 14 +++++++++----- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index de6668415..583a7f30f 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -17,7 +17,7 @@ -- === -- -- ### Author: **applevangelist** --- @date Last Update Nov 2023 +-- @date Last Update Jan 2024 -- @module Ops.AWACS -- @image OPS_AWACS.jpg @@ -507,7 +507,7 @@ do -- @field #AWACS AWACS = { ClassName = "AWACS", -- #string - version = "0.2.59", -- #string + version = "0.2.60", -- #string lid = "", -- #string coalition = coalition.side.BLUE, -- #number coalitiontxt = "blue", -- #string @@ -1405,15 +1405,17 @@ function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number) self.TacticalFrequencies[freq] = freq end if self.AwacsSRS then - self.TacticalSRS = MSRS:New(self.PathToSRS,self.TacticalBaseFreq,self.TacticalModulation,self.Volume) + self.TacticalSRS = MSRS:New(self.PathToSRS,self.TacticalBaseFreq,self.TacticalModulation) self.TacticalSRS:SetCoalition(self.coalition) self.TacticalSRS:SetGender(self.Gender) self.TacticalSRS:SetCulture(self.Culture) self.TacticalSRS:SetVoice(self.Voice) self.TacticalSRS:SetPort(self.Port) self.TacticalSRS:SetLabel("AWACS") + self.TacticalSRS:SetVolume(self.Volume) if self.PathToGoogleKey then - self.TacticalSRS:SetGoogle(self.PathToGoogleKey) + --self.TacticalSRS:SetGoogle(self.PathToGoogleKey) + self.TacticalSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey) end self.TacticalSRSQ = MSRSQUEUE:New("Tactical AWACS") end @@ -2079,8 +2081,9 @@ end -- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS. -- @param #number Volume Volume - between 0.0 (silent) and 1.0 (loudest) -- @param #string PathToGoogleKey Path to your google key if you want to use google TTS +-- @param #string AccessKey Your Google API access key. This is necessary if DCS-gRPC is used as backend. -- @return #AWACS self -function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey) +function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey) self:T(self.lid.."SetSRS") self.PathToSRS = PathToSRS or "C:\\Program Files\\DCS-SimpleRadio-Standalone" self.Gender = Gender or "male" @@ -2088,17 +2091,20 @@ function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey self.Port = Port or 5002 self.Voice = Voice self.PathToGoogleKey = PathToGoogleKey + self.AccessKey = AccessKey self.Volume = Volume or 1.0 - self.AwacsSRS = MSRS:New(self.PathToSRS,self.MultiFrequency,self.MultiModulation,self.Volume) + self.AwacsSRS = MSRS:New(self.PathToSRS,self.MultiFrequency,self.MultiModulation) self.AwacsSRS:SetCoalition(self.coalition) self.AwacsSRS:SetGender(self.Gender) self.AwacsSRS:SetCulture(self.Culture) self.AwacsSRS:SetVoice(self.Voice) self.AwacsSRS:SetPort(self.Port) self.AwacsSRS:SetLabel("AWACS") + self.AwacsSRS:SetVolume(Volume) if self.PathToGoogleKey then - self.AwacsSRS:SetGoogle(self.PathToGoogleKey) + --self.AwacsSRS:SetGoogle(self.PathToGoogleKey) + self.AwacsSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey) end return self @@ -6595,7 +6601,7 @@ function AWACS:onafterCheckTacticalQueue(From,Event,To) if self.PathToGoogleKey then gtext = string.format("%s",gtext) end - self.TacticalSRSQ:NewTransmission(gtext,nil,self.TacticalSRS,nil,0.5,nil,nil,nil,frequency,self.TacticalModulation,nil,nil,nil,nil,nil) + self.TacticalSRSQ:NewTransmission(gtext,nil,self.TacticalSRS,nil,0.5,nil,nil,nil,frequency,self.TacticalModulation) self:T(RadioEntry.TextTTS) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 87b9921cb..79ffe5803 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -21,7 +21,7 @@ -- === -- @module Ops.PlayerTask -- @image OPS_PlayerTask.jpg --- @date Last Update Oct 2023 +-- @date Last Update Jan 2024 do @@ -1552,7 +1552,7 @@ PLAYERTASKCONTROLLER.Messages = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASKCONTROLLER.version="0.1.63" +PLAYERTASKCONTROLLER.version="0.1.64" --- Create and run a new TASKCONTROLLER instance. -- @param #PLAYERTASKCONTROLLER self @@ -4005,9 +4005,10 @@ end -- Note that this must be installed on your windows system. Can also be Google voice types, if you are using Google TTS. -- @param #number Volume (Optional) Volume - between 0.0 (silent) and 1.0 (loudest) -- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS +-- @param #string AccessKey Your Google API access key. This is necessary if DCS-gRPC is used as backend. -- @param Core.Point#COORDINATE Coordinate Coordinate from which the controller radio is sending -- @return #PLAYERTASKCONTROLLER self -function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Coordinate) +function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate) self:T(self.lid.."SetSRS") self.PathToSRS = PathToSRS or "C:\\Program Files\\DCS-SimpleRadio-Standalone" -- self.Gender = Gender or "male" -- @@ -4015,6 +4016,7 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu self.Port = Port or 5002 -- self.Voice = Voice -- self.PathToGoogleKey = PathToGoogleKey -- + self.AccessKey = AccessKey self.Volume = Volume or 1.0 -- self.UseSRS = true self.Frequency = Frequency or {127,251} -- @@ -4022,15 +4024,17 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu self.Modulation = Modulation or {radio.modulation.FM,radio.modulation.AM} -- self.BCModulation = self.Modulation -- set up SRS - self.SRS=MSRS:New(self.PathToSRS,self.Frequency,self.Modulation,self.Volume) + self.SRS=MSRS:New(self.PathToSRS,self.Frequency,self.Modulation) self.SRS:SetCoalition(self.Coalition) self.SRS:SetLabel(self.MenuName or self.Name) self.SRS:SetGender(self.Gender) self.SRS:SetCulture(self.Culture) self.SRS:SetPort(self.Port) self.SRS:SetVoice(self.Voice) + self.SRS:SetVolume(self.Volume) if self.PathToGoogleKey then - self.SRS:SetGoogle(self.PathToGoogleKey) + --self.SRS:SetGoogle(self.PathToGoogleKey) + self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey) end if Coordinate then self.SRS:SetCoordinate(Coordinate)