mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-19 05:36:02 +00:00
xx
This commit is contained in:
@@ -495,7 +495,8 @@ _MESSAGESRS = {}
|
|||||||
-- @param #number Volume (optional) Volume, can be between 0.0 and 1.0 (loudest).
|
-- @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 #string Label (optional) Label, defaults to "MESSAGE" or the Message Category set.
|
||||||
-- @param Core.Point#COORDINATE Coordinate (optional) Coordinate this messages originates from.
|
-- @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
|
-- @usage
|
||||||
-- -- Mind the dot here, not using the colon this time around!
|
-- -- Mind the dot here, not using the colon this time around!
|
||||||
-- -- Needed once only
|
-- -- Needed once only
|
||||||
@@ -503,7 +504,7 @@ _MESSAGESRS = {}
|
|||||||
-- -- later on in your code
|
-- -- later on in your code
|
||||||
-- MESSAGE:New("Test message!",15,"SPAWN"):ToSRS()
|
-- 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"
|
_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)
|
_MESSAGESRS.MSRS:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if Provider then
|
||||||
|
_MESSAGESRS.MSRS:SetProvider(Provider)
|
||||||
|
end
|
||||||
|
|
||||||
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
_MESSAGESRS.label = Label or MSRS.Label or "MESSAGE"
|
||||||
_MESSAGESRS.MSRS:SetLabel(_MESSAGESRS.label)
|
_MESSAGESRS.MSRS:SetLabel(_MESSAGESRS.label)
|
||||||
|
|
||||||
|
|||||||
@@ -2834,16 +2834,18 @@ function CSAR:onafterStart(From, Event, To)
|
|||||||
self.msrs:SetPort(self.SRSport)
|
self.msrs:SetPort(self.SRSport)
|
||||||
self.msrs:SetLabel("CSAR")
|
self.msrs:SetLabel("CSAR")
|
||||||
self.msrs:SetBackend(self.SRSBackend)
|
self.msrs:SetBackend(self.SRSBackend)
|
||||||
self.msrs:SetProvider(self.SRSProvider)
|
|
||||||
self.msrs.speed = self.SRSSpeed
|
self.msrs.speed = self.SRSSpeed
|
||||||
self.msrs:SetCulture(self.SRSCulture)
|
self.msrs:SetCulture(self.SRSCulture)
|
||||||
self.msrs:SetCoalition(self.coalition)
|
self.msrs:SetCoalition(self.coalition)
|
||||||
self.msrs:SetVoice(self.SRSVoice)
|
self.msrs:SetVoice(self.SRSVoice)
|
||||||
self.msrs:SetGender(self.SRSGender)
|
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:SetProviderOptionsGoogle(self.SRSGPathToCredentials,self.SRSGPathToCredentials)
|
||||||
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
self.msrs:SetProvider(MSRS.Provider.GOOGLE)
|
||||||
end
|
end
|
||||||
|
if self.SRSProvider then
|
||||||
|
self.msrs:SetProvider(self.SRSProvider)
|
||||||
|
end
|
||||||
self.msrs:SetVolume(self.SRSVolume)
|
self.msrs:SetVolume(self.SRSVolume)
|
||||||
self.msrs:SetLabel("CSAR")
|
self.msrs:SetLabel("CSAR")
|
||||||
self.SRSQueue = MSRSQUEUE:New("CSAR") -- Sound.SRS#MSRSQUEUE
|
self.SRSQueue = MSRSQUEUE:New("CSAR") -- Sound.SRS#MSRSQUEUE
|
||||||
|
|||||||
@@ -1649,9 +1649,9 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
|
|||||||
elseif self.backend==MSRS.Backend.HOUND then
|
elseif self.backend==MSRS.Backend.HOUND then
|
||||||
-- BASE:I("MSRS.Backend.HOUND")
|
-- 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
|
end
|
||||||
|
|
||||||
@@ -2086,15 +2086,15 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
|
|||||||
modus=modus:gsub("0", "AM")
|
modus=modus:gsub("0", "AM")
|
||||||
modus=modus:gsub("1", "FM")
|
modus=modus:gsub("1", "FM")
|
||||||
|
|
||||||
self:I({T=Message,F=freqs,M=modus,V=voice,Vx=volume,L=label,C=coal,GGL=tostring(UseGoogle)})
|
--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
|
--if (UseGoogle ~= true) and self.provider == MSRS.Provider.GOOGLE then
|
||||||
UseGoogle = true
|
--UseGoogle = true
|
||||||
end
|
--end
|
||||||
|
|
||||||
local provider = self.provider
|
local provider = self.provider
|
||||||
provider=provider:gsub("gcloud", "google")
|
--provider=provider:gsub("gcloud", "google")
|
||||||
provider=provider:gsub("win", "sapi")
|
--provider=provider:gsub("win", "sapi")
|
||||||
|
|
||||||
local TransmissionP = {
|
local TransmissionP = {
|
||||||
freqs = freqs,
|
freqs = freqs,
|
||||||
@@ -2114,6 +2114,9 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
|
|||||||
speaker = Speaker,
|
speaker = Speaker,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UTILS.PrintTableToLog(TransmissionP,indent,noprint,maxDepth,seen)
|
||||||
|
UTILS.PrintTableToLog(ProviderP,indent,noprint,maxDepth,seen)
|
||||||
|
|
||||||
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
|
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
|
||||||
|
|
||||||
return speechtime
|
return speechtime
|
||||||
@@ -2524,6 +2527,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:I({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
|
||||||
|
|||||||
Reference in New Issue
Block a user