mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-14 23:17:56 +00:00
Merge remote-tracking branch 'origin/master-ng' into develop
This commit is contained in:
@@ -1536,7 +1536,7 @@ function MSRS:PlaySoundText(SoundText, Delay)
|
|||||||
if self.backend==MSRS.Backend.GRPC then
|
if self.backend==MSRS.Backend.GRPC then
|
||||||
self:_DCSgRPCtts(SoundText.text, nil, SoundText.gender, SoundText.culture, SoundText.voice, SoundText.volume, SoundText.label, SoundText.coordinate)
|
self:_DCSgRPCtts(SoundText.text, nil, SoundText.gender, SoundText.culture, SoundText.voice, SoundText.volume, SoundText.label, SoundText.coordinate)
|
||||||
elseif self.backend == MSRS.Backend.HOUND then
|
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
|
else
|
||||||
|
|
||||||
-- Get command.
|
-- Get command.
|
||||||
@@ -1561,21 +1561,22 @@ end
|
|||||||
-- @param #number Delay Delay in seconds, before the message is played.
|
-- @param #number Delay Delay in seconds, before the message is played.
|
||||||
-- @param Core.Point#COORDINATE Coordinate Coordinate.
|
-- @param Core.Point#COORDINATE Coordinate Coordinate.
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
|
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
|
||||||
-- @return #MSRS self
|
-- @return #MSRS self
|
||||||
function MSRS:PlayText(Text, Delay, Coordinate, Speed)
|
function MSRS:PlayText(Text, Delay, Coordinate, Speed, Speaker)
|
||||||
self:F( {Text, Delay, Coordinate} )
|
self:F( {Text, Delay, Coordinate} )
|
||||||
|
|
||||||
if Delay and Delay>0 then
|
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
|
else
|
||||||
|
|
||||||
if self.backend==MSRS.Backend.GRPC then
|
if self.backend==MSRS.Backend.GRPC then
|
||||||
self:T(self.lid.."Transmitting")
|
self:T(self.lid.."Transmitting")
|
||||||
self:_DCSgRPCtts(Text, nil, nil , nil, nil, nil, nil, Coordinate)
|
self:_DCSgRPCtts(Text, nil, nil , nil, nil, nil, nil, Coordinate)
|
||||||
elseif self.backend==MSRS.Backend.HOUND then
|
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
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1596,8 +1597,9 @@ end
|
|||||||
-- @param #string Label Label.
|
-- @param #string Label Label.
|
||||||
-- @param Core.Point#COORDINATE Coordinate Coordinate.
|
-- @param Core.Point#COORDINATE Coordinate Coordinate.
|
||||||
-- @param #number Speed Speed.
|
-- @param #number Speed Speed.
|
||||||
|
-- @param #string Speaker Speaker (Sub-Voice) for PIPER only
|
||||||
-- @return #MSRS self
|
-- @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} )
|
self:T({Text, Delay, Frequencies, Modulations, Gender, Culture, Voice, Volume, Label, Coordinate, Speed} )
|
||||||
|
|
||||||
if Delay and Delay>0 then
|
if Delay and Delay>0 then
|
||||||
@@ -1628,7 +1630,7 @@ function MSRS:PlayTextExt(Text, Delay, Frequencies, Modulations, Gender, Culture
|
|||||||
|
|
||||||
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)
|
self:_HoundTextToSpeech(Text,Frequencies,Modulations,Volume,Label,self.coalition,Coordinate,Speed,Gender,Culture,Voice,UseGoogle,Speaker)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2029,8 +2031,9 @@ 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
|
||||||
-- @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)
|
function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Coalition,Point,Speed,Gender,Culture,Voice,UseGoogle,Speaker)
|
||||||
self:I(self.lid.."_HoundTextToSpeech")
|
self:I(self.lid.."_HoundTextToSpeech")
|
||||||
|
|
||||||
Frequencies = UTILS.EnsureTable(Frequencies)
|
Frequencies = UTILS.EnsureTable(Frequencies)
|
||||||
@@ -2087,6 +2090,7 @@ function MSRS:_HoundTextToSpeech(Message,Frequencies,Modulations,Volume,Label,Co
|
|||||||
speed = speed,
|
speed = speed,
|
||||||
culture = culture,
|
culture = culture,
|
||||||
gender = gender,
|
gender = gender,
|
||||||
|
speaker = Speaker,
|
||||||
}
|
}
|
||||||
|
|
||||||
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
|
local speechtime = HoundTTS.Transmit(Message, TransmissionP, ProviderP)
|
||||||
@@ -2407,6 +2411,8 @@ MSRSQUEUE = {
|
|||||||
-- @field #number volume Volume
|
-- @field #number volume Volume
|
||||||
-- @field #string label Label to be used
|
-- @field #string label Label to be used
|
||||||
-- @field Core.Point#COORDINATE coordinate Coordinate for this transmission
|
-- @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
|
-- @field #number speed Speed to be used
|
||||||
|
|
||||||
--- Create a new MSRSQUEUE object for a given radio frequency/modulation.
|
--- Create a new MSRSQUEUE object for a given radio frequency/modulation.
|
||||||
@@ -2493,8 +2499,9 @@ end
|
|||||||
-- @param #string label (Optional) Label to be used
|
-- @param #string label (Optional) Label to be used
|
||||||
-- @param Core.Point#COORDINATE coordinate (Optional) Coordinate to be used
|
-- @param Core.Point#COORDINATE coordinate (Optional) Coordinate to be used
|
||||||
-- @param #number speed (Optional) Speed 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.
|
-- @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})
|
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.TransmitOnlyWithPlayers then
|
||||||
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
|
if self.PlayerSet and self.PlayerSet:CountAlive() == 0 then
|
||||||
@@ -2536,7 +2543,9 @@ function MSRSQUEUE:NewTransmission(text, duration, msrs, tstart, interval, subgr
|
|||||||
transmission.label = label or msrs.Label
|
transmission.label = label or msrs.Label
|
||||||
transmission.coordinate = coordinate or msrs.coordinate
|
transmission.coordinate = coordinate or msrs.coordinate
|
||||||
transmission.speed = speed or 1.0
|
transmission.speed = speed or 1.0
|
||||||
|
if speaker then
|
||||||
|
transmission.speaker = speaker
|
||||||
|
end
|
||||||
-- Add transmission to queue.
|
-- Add transmission to queue.
|
||||||
self:AddTransmission(transmission)
|
self:AddTransmission(transmission)
|
||||||
|
|
||||||
@@ -2550,9 +2559,9 @@ function MSRSQUEUE:Broadcast(transmission)
|
|||||||
self:T(self.lid.."Broadcast")
|
self:T(self.lid.."Broadcast")
|
||||||
|
|
||||||
if transmission.frequency then
|
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
|
else
|
||||||
transmission.msrs:PlayText(transmission.text,nil,transmission.coordinate,transmission.speed)
|
transmission.msrs:PlayText(transmission.text,nil,transmission.coordinate,transmission.speed,transmission.speaker)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function texttogroup(gid)
|
local function texttogroup(gid)
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ do -- Text-To-Speech
|
|||||||
-- @field #string culture Culture, e.g. "en-GB".
|
-- @field #string culture Culture, e.g. "en-GB".
|
||||||
-- @field #string voice Specific voice to use. Overrules `gender` and `culture` settings.
|
-- @field #string voice Specific voice to use. Overrules `gender` and `culture` settings.
|
||||||
-- @field #number speed Specific speed to be used.
|
-- @field #number speed Specific speed to be used.
|
||||||
|
-- @field #string speaker (PIPER/HOUND only) sub-voice speaker to be used.
|
||||||
-- @extends Core.Base#BASE
|
-- @extends Core.Base#BASE
|
||||||
|
|
||||||
|
|
||||||
@@ -427,7 +428,7 @@ do -- Text-To-Speech
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Set to use a specific speed.
|
--- Set to use a specific speed.
|
||||||
-- @param #SOUNDTEXT self
|
-- @param #SOUNDTEXT self
|
||||||
-- @param #number Speed
|
-- @param #number Speed
|
||||||
-- @return #SOUNDTEXT self
|
-- @return #SOUNDTEXT self
|
||||||
@@ -438,4 +439,15 @@ do -- Text-To-Speech
|
|||||||
return self
|
return self
|
||||||
end
|
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
|
end
|
||||||
Reference in New Issue
Block a user