SRS - adding volume setting and a test on OS and IO available

OpsGroup - added volume options for `SetSRS`
This commit is contained in:
Applevangelist 2022-05-05 11:35:27 +02:00
parent 0da8afc108
commit ef4398a5f1
2 changed files with 8 additions and 2 deletions

View File

@ -2039,8 +2039,9 @@ end
-- @param #number Port SRS port. Default 5002. -- @param #number Port SRS port. Default 5002.
-- @param #string PathToGoogleKey Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`. -- @param #string PathToGoogleKey Full path to the google credentials JSON file, e.g. `"C:\Users\myUsername\Downloads\key.json"`.
-- @param #string Label Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed! -- @param #string Label Label of the SRS comms for the SRS Radio overlay. Defaults to "ROBOT". No spaces allowed!
-- @param #number Volume Volume to be set, 0.0 = silent, 1.0 = loudest. Defaults to 1.0
-- @return #OPSGROUP self -- @return #OPSGROUP self
function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label) function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKey, Label, Volume)
self.useSRS=true self.useSRS=true
self.msrs=MSRS:New(PathToSRS, self.frequency, self.modulation) self.msrs=MSRS:New(PathToSRS, self.frequency, self.modulation)
self.msrs:SetGender(Gender) self.msrs:SetGender(Gender)
@ -2052,6 +2053,7 @@ function OPSGROUP:SetSRS(PathToSRS, Gender, Culture, Voice, Port, PathToGoogleKe
self.msrs:SetGoogle(PathToGoogleKey) self.msrs:SetGoogle(PathToGoogleKey)
end end
self.msrs:SetCoalition(self:GetCoalition()) self.msrs:SetCoalition(self:GetCoalition())
self.msrs:SetVolume(Volume)
return self return self
end end

View File

@ -110,7 +110,11 @@
-- ## Set SRS Port -- ## Set SRS Port
-- --
-- Use @{#MSRS.SetPort} to define the SRS port. Defaults to 5002. -- Use @{#MSRS.SetPort} to define the SRS port. Defaults to 5002.
-- --
-- ## Set SRS Volume
--
-- Use @{#MSRS.SetVolume} to define the SRS volume. Defaults to 1.0. Allowed values are between 0.0 and 1.0, from silent to loudest.
--
-- @field #MSRS -- @field #MSRS
MSRS = { MSRS = {
ClassName = "MSRS", ClassName = "MSRS",