This commit is contained in:
Applevangelist
2026-03-07 11:34:46 +01:00
parent 360567ccd7
commit 33bd6cc5a4
3 changed files with 25 additions and 14 deletions
+7 -2
View File
@@ -495,7 +495,8 @@ _MESSAGESRS = {}
-- @param #number Volume (optional) Volume, can be between 0.0 and 1.0 (loudest).
-- @param #string Label (optional) Label, defaults to "MESSAGE" or the Message Category set.
-- @param Core.Point#COORDINATE Coordinate (optional) Coordinate this messages originates from.
-- @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 or MSRS.Backend.HOUND etc
-- @param #string Provider (optional) Privider to be used, can be MSRS.Provider.WINDOWS or MSRS.Backend.GOOGLE or MSRS.Backend.PIPER etc
-- @usage
-- -- Mind the dot here, not using the colon this time around!
-- -- Needed once only
@@ -503,7 +504,7 @@ _MESSAGESRS = {}
-- -- later on in your code
-- MESSAGE:New("Test message!",15,"SPAWN"):ToSRS()
--
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate,Backend)
function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,Gender,Culture,Voice,Coalition,Volume,Label,Coordinate,Backend,Provider)
_MESSAGESRS.PathToSRS = PathToSRS or MSRS.path or "C:\\Program Files\\DCS-SimpleRadio-Standalone\\ExternalAudio"
@@ -536,6 +537,10 @@ function MESSAGE.SetMSRS(PathToSRS,Port,PathToCredentials,Frequency,Modulation,G
_MESSAGESRS.MSRS:SetProvider(MSRS.Provider.GOOGLE)
end
if Provider then
_MESSAGESRS.MSRS:SetProvider(Provider)
end
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
_MESSAGESRS.MSRS:SetLabel(_MESSAGESRS.label)
+5 -3
View File
@@ -2833,17 +2833,19 @@ function CSAR:onafterStart(From, Event, To)
self.msrs = MSRS:New(path,channel,modulation) -- Sound.SRS#MSRS
self.msrs:SetPort(self.SRSport)
self.msrs:SetLabel("CSAR")
self.msrs:SetBackend(self.SRSBackend)
self.msrs:SetProvider(self.SRSProvider)
self.msrs:SetBackend(self.SRSBackend)
self.msrs.speed = self.SRSSpeed
self.msrs:SetCulture(self.SRSCulture)
self.msrs:SetCoalition(self.coalition)
self.msrs:SetVoice(self.SRSVoice)
self.msrs:SetGender(self.SRSGender)
if self.SRSGPathToCredentials then
if self.SRSGPathToCredentials and (not self.SRSProvider) then
self.msrs:SetProviderOptionsGoogle(self.SRSGPathToCredentials,self.SRSGPathToCredentials)
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
end
if self.SRSProvider then
self.msrs:SetProvider(self.SRSProvider)
end
self.msrs:SetVolume(self.SRSVolume)
self.msrs:SetLabel("CSAR")
self.SRSQueue = MSRSQUEUE:New("CSAR") -- Sound.SRS#MSRSQUEUE
+13 -9
View File
@@ -1649,9 +1649,9 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
elseif self.backend==MSRS.Backend.HOUND then
-- BASE:I("MSRS.Backend.HOUND")
local UseGoogle = (self.provider == MSRS.Provider.GOOGLE) and true or nil
--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,Speaker)
self:_HoundTextToSpeech(Text,Frequencies,Modulations,Volume,Label,self.coalition,Coordinate,Speed,Gender,Culture,Voice,nil,Speaker)
end
@@ -2086,15 +2086,15 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
modus=modus:gsub("0", "AM")
modus=modus:gsub("1", "FM")
self:I({T=Message,F=freqs,M=modus,V=voice,Vx=volume,L=label,C=coal,GGL=tostring(UseGoogle)})
if (UseGoogle ~= true) and self.provider == MSRS.Provider.GOOGLE then
UseGoogle = true
end
--self:I({T=Message,F=freqs,M=modus,V=voice,Vx=volume,L=label,C=coal,GGL=tostring(UseGoogle)})
self:I({T=Message})
--if (UseGoogle ~= true) and self.provider == MSRS.Provider.GOOGLE then
--UseGoogle = true
--end
local provider = self.provider
provider=provider:gsub("gcloud", "google")
provider=provider:gsub("win", "sapi")
--provider=provider:gsub("gcloud", "google")
--provider=provider:gsub("win", "sapi")
local TransmissionP = {
freqs = freqs,
@@ -2114,6 +2114,9 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
speaker = Speaker,
}
UTILS.PrintTableToLog(TransmissionP,indent,noprint,maxDepth,seen)
UTILS.PrintTableToLog(ProviderP,indent,noprint,maxDepth,seen)
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
return speechtime
@@ -2524,6 +2527,7 @@ end
-- @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)
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:I({provider=msrs.provider})
if self.TransmitOnlyWithPlayers then
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
return self