This commit is contained in:
Applevangelist
2026-03-05 16:46:11 +01:00
parent f4345e1005
commit 360567ccd7
3 changed files with 58 additions and 15 deletions
+3 -2
View File
@@ -1239,10 +1239,11 @@ function EASYGCICAP:_AddSquadron(TemplateName, SquadName, AirbaseName, AirFrames
Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE)
Squadron_One:SetMissionRange(self.missionrange)
local wing = self.wings[AirbaseName][1] -- Ops.Airwing#AIRWING
local wing = self.wings[AirbaseName][1] -- Ops.AirWing#AIRWING
wing:AddSquadron(Squadron_One)
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5},75)
--local countsquads = UTILS.TableLength(wing.cohorts)
wing:NewPayload(TemplateName,-1,{AUFTRAG.Type.CAP, AUFTRAG.Type.GCICAP, AUFTRAG.Type.INTERCEPT, AUFTRAG.Type.PATROLRACETRACK, AUFTRAG.Type.ALERT5},100)
return self
end
+42 -12
View File
@@ -731,12 +731,14 @@ MSRS.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 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 = {
WINDOWS = "win",
GOOGLE = "gcloud",
AZURE = "azure",
AMAZON = "aws",
PIPER = "piper",
KITTEN = "kitten",
}
--- Function for UUID.
@@ -1197,6 +1199,17 @@ function MSRS:SetVoicePiper(Voice)
return self
end
--- Set to use a specific voice if Kitten is used as provider (only Hound-TTS backend). Note that this will override any gender and culture settings.
-- @param #MSRS self
-- @param #string Voice (Optional) [Kitten Voices](https://github.com/uriba107/HoundTTS#installation). Default `"Bella"`.
-- @return #MSRS self
function MSRS:SetVoiceKitten(Voice)
self:F( {Voice=Voice} )
self:SetVoiceProvider(Voice or "Bella", MSRS.Provider.KITTEN)
return self
end
--- Set to use a specific voice if Microsoft Azure is use as provider (only DCS-gRPC backend). Note that this will override any gender and culture settings.
-- @param #MSRS self
-- @param #string Voice (Optional) [Azure Voice](https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support). Default `"en-US-AriaNeural"`.
@@ -1449,6 +1462,14 @@ function MSRS:SetTTSProviderPiper()
return self
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.
-- @param #MSRS self
@@ -1536,7 +1557,7 @@ function MSRS:PlaySoundText(SoundText, Delay)
if self.backend==MSRS.Backend.GRPC then
self:_DCSgRPCtts(SoundText.text, nil, SoundText.gender, SoundText.culture, SoundText.voice, SoundText.volume, SoundText.label, SoundText.coordinate)
elseif self.backend == MSRS.Backend.HOUND then
self:_HoundTextToSpeech(SoundText.text,nil,nil,SoundText.volume,SoundText.label,self.coalition,SoundText.coordinate,SoundText.Speed,SoundText.gender,SoundText.culture,SoundText.voice)
self:_HoundTextToSpeech(SoundText.text,nil,nil,SoundText.volume,SoundText.label,self.coalition,SoundText.coordinate,SoundText.Speed,SoundText.gender,SoundText.culture,SoundText.voice,nil,SoundText.speaker)
else
-- Get command.
@@ -1561,21 +1582,22 @@ end
-- @param #number Delay Delay in seconds, before the message is played.
-- @param Core.Point#COORDINATE Coordinate Coordinate.
-- @param #number Speed
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
-- @return #MSRS self
function MSRS:PlayText(Text, Delay, Coordinate, Speed)
function MSRS:PlayText(Text, Delay, Coordinate, Speed, Speaker)
self:F( {Text, Delay, Coordinate} )
if Delay and Delay>0 then
self:ScheduleOnce(Delay, MSRS.PlayText, self, Text, nil, Coordinate)
self:ScheduleOnce(Delay, MSRS.PlayText, self, Text, nil, Coordinate, Speed, Speaker)
else
if self.backend==MSRS.Backend.GRPC then
self:T(self.lid.."Transmitting")
self:_DCSgRPCtts(Text, nil, nil , nil, nil, nil, nil, Coordinate)
elseif self.backend==MSRS.Backend.HOUND then
self:_HoundTextToSpeech(Text,nil,nil,nil,nil,nil,Coordinate,Speed)
self:_HoundTextToSpeech(Text,nil,nil,nil,nil,nil,Coordinate,Speed,nil,Speaker)
else
self:PlayTextExt(Text, Delay, nil, nil, nil, nil, nil, nil, nil, Coordinate, Speed)
self:PlayTextExt(Text, Delay, nil, nil, nil, nil, nil, nil, nil, Coordinate, Speed, Speaker)
end
end
@@ -1596,8 +1618,9 @@ end
-- @param #string Label Label.
-- @param Core.Point#COORDINATE Coordinate Coordinate.
-- @param #number Speed Speed.
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
-- @return #MSRS self
function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate,Speed)
function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate,Speed,Speaker)
self:T({Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate, Speed} )
if Delay and Delay>0 then
@@ -1628,7 +1651,7 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
local UseGoogle = (self.provider == MSRS.Provider.GOOGLE) and true or nil
self:_HoundTextToSpeech(Text,Frequencies,Modulations,Volume,Label,self.coalition,Coordinate,Speed,Gender,Culture,Voice,UseGoogle)
self:_HoundTextToSpeech(Text,Frequencies,Modulations,Volume,Label,self.coalition,Coordinate,Speed,Gender,Culture,Voice,UseGoogle,Speaker)
end
@@ -2029,8 +2052,9 @@ end
-- @param #string Culture (Optional) Culture to use.
-- @param #string Voice (Optional) Voice to use.
-- @param #boolean UseGoogle (Optional) If to use Google TTS.
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
-- @return SpeechTime Speech time in seconds.
function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle)
function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle,Speaker)
self:I(self.lid.."_HoundTextToSpeech")
Frequencies = UTILS.EnsureTable(Frequencies)
@@ -2087,6 +2111,7 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
speed = speed,
culture = culture,
gender = gender,
speaker = Speaker,
}
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
@@ -2407,6 +2432,8 @@ MSRSQUEUE = {
-- @field #number volume Volume
-- @field #string label Label to be used
-- @field Core.Point#COORDINATE coordinate Coordinate for this transmission
-- @field #number speed Speed of speech 1=100%
-- @field #string speaker PIPER subvoice "speaker"
-- @field #number speed Speed to be used
--- Create a new MSRSQUEUE object for a given radio frequency/modulation.
@@ -2493,8 +2520,9 @@ end
-- @param #string label (Optional) Label to be used
-- @param Core.Point#COORDINATE coordinate (Optional) Coordinate to be used
-- @param #number speed (Optional) Speed to be used
-- @param #string speaker (Optional) PIPER voice can have various speakers, set this here if you use PIPER/HOUND with a fitting voice.
-- @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)
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})
if self.TransmitOnlyWithPlayers then
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
@@ -2536,7 +2564,9 @@ function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgr
transmission.label = label or msrs.Label
transmission.coordinate = coordinate or msrs.coordinate
transmission.speed = speed or 1.0
if speaker then
transmission.speaker = speaker
end
-- Add transmission to queue.
self:AddTransmission(transmission)
@@ -2550,9 +2580,9 @@ function MSRSQUEUE:Broadcast(transmission)
self:T(self.lid.."Broadcast")
if transmission.frequency then
transmission.msrs:PlayTextExt(transmission.text, nil, transmission.frequency, transmission.modulation, transmission.gender, transmission.culture, transmission.voice, transmission.volume, transmission.label, transmission.coordinate, transmission.speed)
transmission.msrs:PlayTextExt(transmission.text, nil, transmission.frequency, transmission.modulation, transmission.gender, transmission.culture, transmission.voice, transmission.volume, transmission.label, transmission.coordinate, transmission.speed, transmission.speaker)
else
transmission.msrs:PlayText(transmission.text,nil,transmission.coordinate,transmission.speed)
transmission.msrs:PlayText(transmission.text,nil,transmission.coordinate,transmission.speed,transmission.speaker)
end
local function texttogroup(gid)
+13 -1
View File
@@ -301,6 +301,7 @@ do -- Text-To-Speech
-- @field #string culture Culture, e.g. "en-GB".
-- @field #string voice Specific voice to use. Overrules `gender` and `culture` settings.
-- @field #number speed Specific speed to be used.
-- @field #string speaker (PIPER/HOUND only) sub-voice speaker to be used.
-- @extends Core.Base#BASE
@@ -427,7 +428,7 @@ do -- Text-To-Speech
return self
end
--- Set to use a specific speed.
--- Set to use a specific speed.
-- @param #SOUNDTEXT self
-- @param #number Speed
-- @return #SOUNDTEXT self
@@ -438,4 +439,15 @@ do -- Text-To-Speech
return self
end
--- Set to use a specific speaker (PIPER sub-voice).
-- @param #SOUNDTEXT self
-- @param #string Speaker
-- @return #SOUNDTEXT self
function SOUNDTEXT:SetSpeaker(Speaker)
self.speaker = Speaker
return self
end
end