Added demo missions for MSRS

This commit is contained in:
kaltokri 2023-12-28 16:52:08 +01:00
parent b5ea9cdb5d
commit 9159560cb8
9 changed files with 121589 additions and 0 deletions

View File

@ -0,0 +1,31 @@
-- This demo mission will play an internal audio file.
-- This is a file which is part of the .miz file.
-- Enter the A-10CII and listen to the radio.
-- If you don't own A-10CII you have to change the mission to use another aircraft.
-- Check dcs.log if something is not working:
BASE:TraceClass("MSRS")
BASE:TraceClass("SOUNDFILE")
BASE:TraceLevel(3)
BASE:TraceOnOff( true )
FileName = "Hello-world.ogg"
FolderPath=nil -- Will use l10n/DEFAULT/ as default
Duration=nil -- Will use 3 seconds as default
UseSrs=true
InstallPathSrs=nil -- This will use the default installation path of SRS
-- If you did't install SRS into the default path uncomment and change the line below.
--InstallPathSrs = "G:\\Spiele\\DCS\\Tools\\DCS-SimpleRadio-Standalone"
local soundfile=SOUNDFILE:New(FileName, FolderPath, Duration, UseSrs)
local msrs=MSRS:New( InstallPathSrs, 251, radio.modulation.AM)
local function msg()
MESSAGE:New( "I try to play the internal sound file now!" ):ToAll():ToLog()
msrs:PlaySoundFile(soundfile)
end
-- Use a timer to delay the transmission 2 seconds after script is executeed.
-- Repeat transmission every 10 seconds.
TIMER:New( msg ):Start(2, 10)

View File

@ -0,0 +1,33 @@
-- This demo mission will play an external audio file.
-- This is a file which is not part of the .miz file.
-- Save the file Hello-world.ogg to your Missions folder,
-- e.g. C:\Users\<YourUserName>\Saved Games\DCS.openbeta\Missions
-- Enter the A-10CII and listen to the radio.
-- If you don't own A-10CII you have to change the mission to use another aircraft.
-- Check dcs.log if something is not working:
BASE:TraceClass("MSRS")
BASE:TraceClass("SOUNDFILE")
BASE:TraceLevel(3)
BASE:TraceOnOff( true )
FileName = "Hello-world.ogg"
FolderPath = lfs.writedir() .. 'Missions'
Duration=nil -- Will use 3 seconds as default
UseSrs=true
InstallPathSrs=nil -- This will use the default installation path of SRS
-- If you did't install SRS into the default path uncomment and change the line below.
--InstallPathSrs = "G:\\Spiele\\DCS\\Tools\\DCS-SimpleRadio-Standalone"
local soundfile=SOUNDFILE:New(FileName, FolderPath, Duration, UseSrs)
local msrs=MSRS:New( InstallPathSrs, 251, radio.modulation.AM)
local function msg()
MESSAGE:New( "I try to play the external sound file now!" ):ToAll():ToLog()
msrs:PlaySoundFile(soundfile)
end
-- Use a timer to delay the transmission 2 seconds after script is executeed.
-- Repeat transmission every 10 seconds.
TIMER:New( msg ):Start(2, 10)

View File

@ -0,0 +1,26 @@
----
-- MSRS: Config Windows
--
-- This is a simple demo mission that shows how to use the MSRS class to provide text-to-speech via SRS.
-- Therefore, you need to have the SRS cliend and server installed and running on your system.
--
-- The parameters are taken from a config file "Moose_MSRS.lua", which is included in the demo directory.
-- You need to copy this file to your "Saved Games/DCS/Config/" directory and adjust the necessary parameters.
-- In particular, you need to set the path where SRS is installed on your system.
-- Also the voice used will be "Microsoft Hazel Desktop". You need to either install that on your windows
-- system or change it to a voice you have installed.
-- The config file is automatically loaded when Moose is loaded. So you do not need to worry about it.
--
-- First, we create a MSRS instance, which will transmit on 305 MHz AM.
-- The text is then broadcasted after 5 seconds.
--
-- You can either use the SRS awacs overlay or just into the F/A-18 Hornet client to listen in on the transmission.
---
-- Create a new MSRS instance. Frequency is 305 MHz AM(=0).
-- The first parameter (nil) is the SRS installation path. This is taken from the Moose_MSRS.lua config file.
local msrs=MSRS:New(nil, 305.00, 0)
-- Broadcast text after 5 seconds.
msrs:PlayText("Hello World, this is the Moose simple radio text-to-speech class speaking.", 5)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,40 @@
-- Moose MSRS default Config
MSRS_Config = {
Path = "C:\\Program Files\\DCS-SimpleRadio-Standalone", -- Path to SRS install directory. Mind the double backslashes.
Port = 5002, -- Port of SRS server. Default 5002.
Backend = "srsexe", -- Interface to SRS: "srsexe" or "grpc".
Frequency = {127, 243}, -- Default frequences. Must be a table 1..n entries!
Modulation = {0,0}, -- Default modulations. Must be a table, 1..n entries, one for each frequency!
Volume = 1.0, -- Default volume [0,1].
Coalition = 0, -- 0 = Neutral, 1 = Red, 2 = Blue (only a factor if SRS server has encryption enabled).
Coordinate = {0,0,0}, -- x, y, alt (only a factor if SRS server has line-of-sight and/or distance limit enabled).
Culture = "en-GB",
Gender = "male",
Voice = "Microsoft Hazel Desktop", -- Voice that is used if no explicit provider voice is specified.
Label = "MSRS",
Provider = "win", --Provider for generating TTS (win, gcloud, azure, aws).
-- Windows
win = {
voice = "Microsoft Hazel Desktop", -- Native Windows TTS engine. That voice needs to be installed on your system.
},
-- Google Cloud
gcloud = {
voice = "en-GB-Standard-A", -- The Google Cloud voice to use (see https://cloud.google.com/text-to-speech/docs/voices).
credentials="C:\\Program Files\\DCS-SimpleRadio-Standalone\\yourfilename.json", -- Full path to credentials JSON file (only for SRS-TTS.exe backend)
key="Your access Key", -- Google API access key (only for DCS-gRPC backend)
},
-- Amazon Web Service
aws = {
voice = "Brian", -- The default AWS voice to use (see https://docs.aws.amazon.com/polly/latest/dg/voicelist.html).
key="Your Access Key", -- Your AWS key.
secret="Your secret key", -- Your AWS secret key.
region="eu-central-1", -- Your AWS region (see https://docs.aws.amazon.com/general/latest/gr/pol.html).
},
-- Microsoft Azure
azure = {
voice="en-US-AriaNeural", --The default Azure voice to use (see https://learn.microsoft.com/azure/cognitive-services/speech-service/language-support).
key="Your access key", -- Your Azure access key.
region="westeurope", -- The Azure region to use (see https://learn.microsoft.com/en-us/azure/cognitive-services/speech-service/regions).
},
}