Updated Moose.lua

This commit is contained in:
funkyfranky
2023-12-28 15:53:47 +00:00
parent 9159560cb8
commit 0ebb04db83
423 changed files with 90 additions and 90 deletions

View File

@@ -1,31 +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)
-- 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

@@ -1,33 +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)
-- 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

@@ -1,26 +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)
----
-- 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)