mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-11 03:43:38 +00:00
#VARIOUS - Added provider options for TTS and updated logic
This commit is contained in:
@@ -1672,9 +1672,10 @@ end
|
||||
-- @param #string Culture (Optional) Culture, e.g. "en-GB" (default).
|
||||
-- @param #string Voice (Optional) Specific voice. Overrides `Gender` and `Culture`.
|
||||
-- @param #number Port (Optional) SRS port. Default 5002.
|
||||
-- @param #string GoogleKey Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend).
|
||||
-- @param #string GoogleKey (Optional) Path to Google JSON-Key (SRS exe backend) or Google API key (DCS-gRPC backend).
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #ATIS self
|
||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
||||
function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey,Provider)
|
||||
--if PathToSRS or MSRS.path then
|
||||
self.useSRS=true
|
||||
|
||||
@@ -1700,6 +1701,9 @@ function ATIS:SetSRS(PathToSRS, Gender, Culture, Voice, Port, GoogleKey)
|
||||
end
|
||||
self.msrs:SetVoice(voice)
|
||||
self.msrs:SetCoordinate(self.airbase:GetCoordinate())
|
||||
if Provider then
|
||||
self.msrs:SetProvider(Provider)
|
||||
end
|
||||
self.msrsQ = MSRSQUEUE:New("ATIS")
|
||||
self.msrsQ:SetTransmitOnlyWithPlayers(self.TransmitOnlyWithPlayers)
|
||||
if self.dTQueueCheck<=10 then
|
||||
|
||||
@@ -1415,11 +1415,12 @@ end
|
||||
-- @param #number Modulation (Optional) Modulation to use, defaults to radio.modulation.AM.
|
||||
-- @param #number Interval Seconds between each update call.
|
||||
-- @param #number Number Number of Frequencies to create, can be 1..10.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
||||
function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number,Provider)
|
||||
self:T(self.lid.."SetTacticalRadios")
|
||||
if not self.AwacsSRS then
|
||||
MESSAGE:New("AWACS: Setup SRS in your code BEFORE trying to add tac radios please!",30,"ERROR",true):ToLog():ToAll()
|
||||
MESSAGE:New("AWACS: Setup SRS in your code BEFORE trying to add tactical radios please!",30,"ERROR",true):ToLog():ToAll()
|
||||
return self
|
||||
end
|
||||
self.TacticalMenu = true
|
||||
@@ -1448,6 +1449,9 @@ function AWACS:SetTacticalRadios(BaseFreq,Increase,Modulation,Interval,Number)
|
||||
self.TacticalSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||
self.TacticalSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.TacticalSRS:SetProvider(Provider)
|
||||
end
|
||||
self.TacticalSRSQ = MSRSQUEUE:New("Tactical AWACS")
|
||||
end
|
||||
return self
|
||||
@@ -2186,8 +2190,9 @@ end
|
||||
-- @param #string PathToGoogleKey (Optional) Path to your google key if you want to use google TTS; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string Backend (Optional) Your MSRS Backend if different from your config file settings, e.g. MSRS.Backend.SRSEXE or MSRS.Backend.GRPC
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #AWACS self
|
||||
function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Backend)
|
||||
function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Backend,Provider)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
|
||||
self.Gender = Gender or MSRS.gender or "male"
|
||||
@@ -2210,6 +2215,9 @@ function AWACS:SetSRS(PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey
|
||||
--self.AwacsSRS:SetGoogle(self.PathToGoogleKey)
|
||||
self.AwacsSRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.AccessKey)
|
||||
self.AwacsSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.AwacsSRS:SetProvider(Provider)
|
||||
end
|
||||
-- Pre-configured Google?
|
||||
if (not PathToGoogleKey) and self.AwacsSRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
|
||||
@@ -2839,7 +2839,7 @@ function CSAR:onafterStart(From, Event, To)
|
||||
self.msrs:SetCoalition(self.coalition)
|
||||
self.msrs:SetVoice(self.SRSVoice)
|
||||
self.msrs:SetGender(self.SRSGender)
|
||||
if self.SRSGPathToCredentials and (not self.SRSProvider) then
|
||||
if self.SRSGPathToCredentials then
|
||||
self.msrs:SetProviderOptionsGoogle(self.SRSGPathToCredentials,self.SRSGPathToCredentials)
|
||||
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
|
||||
@@ -364,8 +364,9 @@ FLIGHTCONTROL.version="0.7.7"
|
||||
-- @param #string PathToSRS (Optional) Path to the directory, where SRS is located.
|
||||
-- @param #number Port (Optional) Port of SRS Server, defaults to 5002
|
||||
-- @param #string GoogleKey (Optional) Path to the Google JSON-Key.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #FLIGHTCONTROL self
|
||||
function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, GoogleKey)
|
||||
function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port, GoogleKey,Provider)
|
||||
|
||||
-- Inherit everything from FSM class.
|
||||
local self=BASE:Inherit(self, FSM:New()) -- #FLIGHTCONTROL
|
||||
@@ -436,6 +437,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
||||
if GoogleKey then
|
||||
self.msrsTower:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||
self.msrsTower:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrsTower:SetProvider(Provider)
|
||||
end
|
||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||
self:SetSRSTower()
|
||||
@@ -446,6 +450,9 @@ function FLIGHTCONTROL:New(AirbaseName, Frequency, Modulation, PathToSRS, Port,
|
||||
if GoogleKey then
|
||||
self.msrsPilot:SetProviderOptionsGoogle(GoogleKey,GoogleKey)
|
||||
self.msrsPilot:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrsPilot:SetProvider(Provider)
|
||||
end
|
||||
self.msrsTower:SetCoordinate(self:GetCoordinate())
|
||||
self:SetSRSPilot()
|
||||
|
||||
@@ -2355,8 +2355,9 @@ end
|
||||
-- @param #string PathToGoogleKey (Optional) Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`.
|
||||
-- @param #string Label (Optional) Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed!
|
||||
-- @param #number Volume (Optional) Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #OPSGROUP self
|
||||
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume)
|
||||
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume,Provider)
|
||||
self.useSRS=true
|
||||
local path = PathToSRS or MSRS.path
|
||||
local port = Port or MSRS.port
|
||||
@@ -2370,6 +2371,9 @@ function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKe
|
||||
self.msrs:SetProviderOptionsGoogle(PathToGoogleKey,PathToGoogleKey)
|
||||
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.msrs:SetProvider(Provider)
|
||||
end
|
||||
self.msrs:SetCoalition(self:GetCoalition())
|
||||
self.msrs:SetVolume(Volume)
|
||||
return self
|
||||
|
||||
@@ -1552,9 +1552,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 Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC
|
||||
-- @param #string Backend (optional) Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC etc
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #PLAYERRECCE self
|
||||
function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Backend)
|
||||
function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,Backend,Provider)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" --
|
||||
self.Gender = Gender or MSRS.gender or "male" --
|
||||
@@ -1582,6 +1583,9 @@ function PLAYERRECCE:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,V
|
||||
if self.PathToGoogleKey then
|
||||
self.SRS:SetProviderOptionsGoogle(self.PathToGoogleKey,self.PathToGoogleKey)
|
||||
self.SRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
-- Pre-configured Google?
|
||||
if (not PathToGoogleKey) and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then
|
||||
|
||||
@@ -4908,11 +4908,12 @@ 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; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string AccessKey (Optional) Your Google API access key. This is necessary if DCS-gRPC is used as backend; if you use a config file for MSRS, you can hand in nil here.
|
||||
-- @param Core.Point#COORDINATE Coordinate (Optional) Coordinate from which the controller radio is sending
|
||||
-- @param #string Backend (Optional) MSRS Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC; if you use a config file for MSRS, hand in nil here.
|
||||
-- @param #string Backend (Optional) MSRS Backend to be used, can be MSRS.Backend.SRSEXE or MSRS.Backend.GRPC; if you use a config file for MSRS, you can hand in nil here.
|
||||
-- @param #string Provider (Optional) TTS Provider to be used.
|
||||
-- @return #PLAYERTASKCONTROLLER self
|
||||
function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate,Backend)
|
||||
function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Culture,Port,Voice,Volume,PathToGoogleKey,AccessKey,Coordinate,Backend,Provider)
|
||||
self:T(self.lid.."SetSRS")
|
||||
self.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio" --
|
||||
self.Gender = Gender or MSRS.gender or "male" --
|
||||
@@ -4946,6 +4947,9 @@ function PLAYERTASKCONTROLLER:SetSRS(Frequency,Modulation,PathToSRS,Gender,Cultu
|
||||
self.Voice = Voice or MSRS.poptions.gcloud.voice
|
||||
self.AccessKey = AccessKey or MSRS.poptions.gcloud.key
|
||||
end
|
||||
if Provider then
|
||||
self.SRS:SetProvider(Provider)
|
||||
end
|
||||
if Coordinate then
|
||||
self.SRS:SetCoordinate(Coordinate)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user