mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-10 17:59:24 +00:00
Merge remote-tracking branch 'origin/master-ng' into develop
This commit is contained in:
@@ -2285,6 +2285,7 @@ function SPAWN:SpawnAtAirbase( SpawnAirbase, Takeoff, TakeoffAltitude, TerminalT
|
|||||||
end
|
end
|
||||||
|
|
||||||
Takeoff = GROUP.Takeoff.Air
|
Takeoff = GROUP.Takeoff.Air
|
||||||
|
spawnonground = false
|
||||||
else
|
else
|
||||||
self:E( string.format( "WARNING: Group %s has no parking spots at %s ==> No emergency air start or uncontrolled spawning ==> No spawn!", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
self:E( string.format( "WARNING: Group %s has no parking spots at %s ==> No emergency air start or uncontrolled spawning ==> No spawn!", self.SpawnTemplatePrefix, SpawnAirbase:GetName() ) )
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ MSRS = {
|
|||||||
|
|
||||||
--- MSRS class version.
|
--- MSRS class version.
|
||||||
-- @field #string version
|
-- @field #string version
|
||||||
MSRS.version="0.3.4"
|
MSRS.version="0.3.5"
|
||||||
|
|
||||||
--- Voices
|
--- Voices
|
||||||
-- @type MSRS.Voices
|
-- @type MSRS.Voices
|
||||||
@@ -731,12 +731,14 @@ MSRS.Backend = {
|
|||||||
-- @field #string AZURE Microsoft Azure (`azure`). Only possible with DCS-gRPC backend.
|
-- @field #string AZURE Microsoft Azure (`azure`). Only possible with DCS-gRPC backend.
|
||||||
-- @field #string AMAZON Amazon Web Service (`aws`). Only possible with DCS-gRPC backend.
|
-- @field #string AMAZON Amazon Web Service (`aws`). Only possible with DCS-gRPC backend.
|
||||||
-- @field #string PIPER Piper local voice service. Only possible with Hound-TTS backend.
|
-- @field #string PIPER Piper local voice service. Only possible with Hound-TTS backend.
|
||||||
|
-- @field #string KITTEN Kitten voice server. Only possible with Hound-TTS backend.
|
||||||
MSRS.Provider = {
|
MSRS.Provider = {
|
||||||
WINDOWS = "win",
|
WINDOWS = "win",
|
||||||
GOOGLE = "gcloud",
|
GOOGLE = "gcloud",
|
||||||
AZURE = "azure",
|
AZURE = "azure",
|
||||||
AMAZON = "aws",
|
AMAZON = "aws",
|
||||||
PIPER = "piper",
|
PIPER = "piper",
|
||||||
|
KITTEN = "kitten",
|
||||||
}
|
}
|
||||||
|
|
||||||
--- Function for UUID.
|
--- Function for UUID.
|
||||||
@@ -1460,6 +1462,14 @@ function MSRS:SetTTSProviderPiper()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Use Kitten to provide text-to-speech. Only supported if used in combination with Hound-TTS as backend.
|
||||||
|
-- @param #MSRS self
|
||||||
|
-- @return #MSRS self
|
||||||
|
function MSRS:SetTTSProviderKitten()
|
||||||
|
self:F()
|
||||||
|
self:SetProvider(MSRS.Provider.KITTEN)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Print SRS help to DCS log file.
|
--- Print SRS help to DCS log file.
|
||||||
-- @param #MSRS self
|
-- @param #MSRS self
|
||||||
@@ -1490,6 +1500,19 @@ function MSRS:Help()
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Auto-translate messages on-the-fly with Hound Translate services. Tested with google cloud.
|
||||||
|
-- @param #MSRS self
|
||||||
|
-- @param #string Provider Provider to be used. Defaults to MSRS.Provider.GOOGLE. Options see [Hound Github](https://github.com/uriba107/HoundTTS?tab=readme-ov-file)
|
||||||
|
-- @param #string Language Language to translate to, defaults to "de" (German). Takes [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language codes.
|
||||||
|
-- @return #MSRS self
|
||||||
|
function MSRS:SetAutoTranslate(Provider, Language)
|
||||||
|
self:T(self.lid.."SetAutoTranslate")
|
||||||
|
self.SRSTranslate = true
|
||||||
|
self.SRSTranslateProvider = Provider or MSRS.Provider.GOOGLE
|
||||||
|
self.SRSTranslateLanguage = Language or "de"
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- Transmission Functions
|
-- Transmission Functions
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -2046,11 +2069,25 @@ end
|
|||||||
-- @param #string Culture (Optional) Culture to use.
|
-- @param #string Culture (Optional) Culture to use.
|
||||||
-- @param #string Voice (Optional) Voice to use.
|
-- @param #string Voice (Optional) Voice to use.
|
||||||
-- @param #boolean UseGoogle (Optional) If to use Google TTS.
|
-- @param #boolean UseGoogle (Optional) If to use Google TTS.
|
||||||
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
|
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only.
|
||||||
|
-- @param #boolean Translated (INTERNAL, do not use!) Setting for the callback post translation.
|
||||||
-- @return SpeechTime Speech time in seconds.
|
-- @return SpeechTime Speech time in seconds.
|
||||||
function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle,Speaker)
|
function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle,Speaker,Translated)
|
||||||
self:T(self.lid.."_HoundTextToSpeech")
|
self:T(self.lid.."_HoundTextToSpeech")
|
||||||
|
|
||||||
|
if self.SRSTranslate == true and Translated ~= true then
|
||||||
|
MSRS._HoundTranslate(Message,{provider=self.SRSTranslateProvider, language=self.SRSTranslateLanguage},
|
||||||
|
function(translated,err)
|
||||||
|
if translated then
|
||||||
|
return MSRS._HoundTextToSpeech(self,translated,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle,Speaker,true)
|
||||||
|
else
|
||||||
|
env.error("Translation failed: " .. tostring(err))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
Frequencies = UTILS.EnsureTable(Frequencies)
|
Frequencies = UTILS.EnsureTable(Frequencies)
|
||||||
Modulations = UTILS.EnsureTable(Modulations)
|
Modulations = UTILS.EnsureTable(Modulations)
|
||||||
|
|
||||||
@@ -2153,7 +2190,7 @@ end
|
|||||||
|
|
||||||
--- Hound Test Tone function, sends a 2-second 440 Hz sine wave tone directly over SRS, bypassing the TTS engine entirely.
|
--- Hound Test Tone function, sends a 2-second 440 Hz sine wave tone directly over SRS, bypassing the TTS engine entirely.
|
||||||
-- Use this to verify the SRS connection is working before debugging TTS issues.
|
-- Use this to verify the SRS connection is working before debugging TTS issues.
|
||||||
-- @param MSRS self
|
-- @param #MSRS self
|
||||||
-- @param #table Frequencies The table of frequencies to use.
|
-- @param #table Frequencies The table of frequencies to use.
|
||||||
-- @param #table Modulations The table of modulations to use.
|
-- @param #table Modulations The table of modulations to use.
|
||||||
-- @param #number Coalition The coalition to use.
|
-- @param #number Coalition The coalition to use.
|
||||||
@@ -2179,7 +2216,7 @@ function MSRS:_HoundTestTone(Frequencies, Modulations, Coalition)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--- Hound speech time calculator. Use to determine how long it takes to speak something out.
|
--- Hound speech time calculator. Use to determine how long it takes to speak something out.
|
||||||
-- @param MSRS self
|
-- @param #MSRS self
|
||||||
-- @param #string Message The message to measure. Can also be handed as string lenght.
|
-- @param #string Message The message to measure. Can also be handed as string lenght.
|
||||||
-- @param #number Speed (Optional) The speed to use, defaults to 1.0.
|
-- @param #number Speed (Optional) The speed to use, defaults to 1.0.
|
||||||
-- @param #boolean UseGoogle (Optional) If to use google. Default: no.
|
-- @param #boolean UseGoogle (Optional) If to use google. Default: no.
|
||||||
@@ -2190,6 +2227,37 @@ function MSRS:_HoundSpeechTime(Message,Speed,UseGoogle)
|
|||||||
return speechtime
|
return speechtime
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Hound text translator. Use to translate a message into another language and hand the translation to a function.
|
||||||
|
-- @param #string Message The Message to be translated.
|
||||||
|
-- @param #table Parameters Parameter table. Optional. Defaults to provider google and language "de". Takes ISO 639-1 language codes.
|
||||||
|
-- @param #function CallbackFunction The function we hand the translated text to.
|
||||||
|
-- @usage
|
||||||
|
--
|
||||||
|
-- MSRS._HoundTranslate("Two contacts, BULLSEYE 270 for 40",
|
||||||
|
-- { provider = MSRS.Provider.GOOGLE, language = "de" },
|
||||||
|
-- function(translated, err)
|
||||||
|
-- if translated then
|
||||||
|
-- MESSAGE:New(translated,10):ToAll()
|
||||||
|
-- else
|
||||||
|
-- env.error("Translation failed: " .. tostring(err))
|
||||||
|
-- end
|
||||||
|
-- end)
|
||||||
|
--
|
||||||
|
function MSRS._HoundTranslate(Message,Parameters,CallbackFunction)
|
||||||
|
local text = Message
|
||||||
|
local parameters = Parameters or {}
|
||||||
|
local callback = CallbackFunction
|
||||||
|
if not callback then
|
||||||
|
env.error("_HoundTranslate - not callback function provided!",true)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if not parameters.provider then parameters.provider = MSRS.Provider.GOOGLE end
|
||||||
|
parameters.provider = string.gsub(parameters.provider,"gcloud","google")
|
||||||
|
if not parameters.language then parameters.language = "de" end
|
||||||
|
HoundTTS.Translate(text,parameters,callback)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
-- Config File
|
-- Config File
|
||||||
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -2519,6 +2587,7 @@ end
|
|||||||
-- @return #MSRSQUEUE.Transmission Radio transmission table.
|
-- @return #MSRSQUEUE.Transmission Radio transmission table.
|
||||||
function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgroups, subtitle, subduration, frequency, modulation, gender, culture, voice, volume, label,coordinate,speed,speaker)
|
function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgroups, subtitle, subduration, frequency, modulation, gender, culture, voice, volume, label,coordinate,speed,speaker)
|
||||||
self:T({Text=text, Dur=duration, start=tstart, int=interval, sub=subgroups, subt=subtitle, sudb=subduration, F=frequency, M=modulation, G=gender, C=culture, V=voice, Vol=volume, L=label, S=speed})
|
self:T({Text=text, Dur=duration, start=tstart, int=interval, sub=subgroups, subt=subtitle, sudb=subduration, F=frequency, M=modulation, G=gender, C=culture, V=voice, Vol=volume, L=label, S=speed})
|
||||||
|
self:T({provider=msrs.provider})
|
||||||
if self.TransmitOnlyWithPlayers then
|
if self.TransmitOnlyWithPlayers then
|
||||||
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
|
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
|
||||||
return self
|
return self
|
||||||
@@ -2587,7 +2656,7 @@ function MSRSQUEUE:Broadcast(transmission)
|
|||||||
trigger.action.outTextForGroup(gid, transmission.subtitle, transmission.subduration, true)
|
trigger.action.outTextForGroup(gid, transmission.subtitle, transmission.subduration, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
if transmission.subgroups and #transmission.subgroups>0 then
|
if transmission.subgroups and #transmission.subgroups>0 and transmission.subtitle then
|
||||||
|
|
||||||
for _,_group in pairs(transmission.subgroups) do
|
for _,_group in pairs(transmission.subgroups) do
|
||||||
local group=_group --Wrapper.Group#GROUP
|
local group=_group --Wrapper.Group#GROUP
|
||||||
|
|||||||
Reference in New Issue
Block a user