diff --git a/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.lua b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.lua index 87d8193..3124acc 100644 --- a/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.lua +++ b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.lua @@ -1,50 +1,50 @@ ---- --- Author: kaltokri --- Created: 28.12.2023 --- Contributors: - --- Modified: 17.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html --- --- # Description: --- --- This demo mission will play an internal audio file. --- This is a file which is part of the .miz file. --- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. --- --- Take a look at the ONCE trigger with name "Save Sound in Miz". --- We use it to store the sound file within the mission, but it will never be played by this trigger, because the FLAG --- with name Never is never set to true. This is usefull to thore single sound files. For a bit amount of sound files --- another approch is needed (take a look at the ATIS class description). --- --- # Guide: --- --- 1. Enter the A-10CII and listen to the radio. - --- 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) +--- +-- Author: kaltokri +-- Created: 28.12.2023 +-- Contributors: - +-- Modified: 17.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html +-- +-- # Description: +-- +-- This demo mission will play an internal audio file. +-- This is a file which is part of the .miz file. +-- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. +-- +-- Take a look at the ONCE trigger with name "Save Sound in Miz". +-- We use it to store the sound file within the mission, but it will never be played by this trigger, because the FLAG +-- with name Never is never set to true. This is usefull to thore single sound files. For a bit amount of sound files +-- another approch is needed (take a look at the ATIS class description). +-- +-- # Guide: +-- +-- 1. Enter the A-10CII and listen to the radio. + +-- 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) diff --git a/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.lua b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.lua index a39d2f0..258ff30 100644 --- a/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.lua +++ b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.lua @@ -1,47 +1,47 @@ ---- --- Author: kaltokri --- Created: 28.12.2023 --- Contributors: - --- Modified: 17.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html --- --- # Description: --- --- This demo mission will play an external audio file. --- This is a file which is NOT part of the .miz file. --- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. --- --- # Guide: --- --- 1. Save the file Hello-world.ogg to your Missions folder, --- e.g. C:\Users\\Saved Games\DCS.openbeta\Missions. --- 2. Enter the A-10CII and listen to the radio. - --- 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) +--- +-- Author: kaltokri +-- Created: 28.12.2023 +-- Contributors: - +-- Modified: 17.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html +-- +-- # Description: +-- +-- This demo mission will play an external audio file. +-- This is a file which is NOT part of the .miz file. +-- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. +-- +-- # Guide: +-- +-- 1. Save the file Hello-world.ogg to your Missions folder, +-- e.g. C:\Users\\Saved Games\DCS.openbeta\Missions. +-- 2. Enter the A-10CII and listen to the radio. + +-- 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) diff --git a/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.lua b/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.lua index 6dbc5b6..c4c6c89 100644 --- a/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.lua +++ b/Sound/MSRS/003-PlayTextFile/MSRS-003-PlayTextFile.lua @@ -1,39 +1,39 @@ ---- --- Author: kaltokri --- Created: 28.12.2023 --- Contributors: - --- Modified: 17.02.2024 --- --- # Documentation: --- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html --- --- # Description: --- --- This demo mission will read an external text file. --- This is a file which is not part of the .miz file. --- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. --- --- # Guide: --- --- 1. Save the file Hello-world.txt to your Missions folder, --- e.g. C:\Users\\Saved Games\DCS.openbeta\Missions. --- 2. Enter the A-10CII and listen to the radio. - --- Check dcs.log if something is not working: -BASE:TraceClass("MSRS") -BASE:TraceLevel(3) -BASE:TraceOnOff( true ) - --- Force to use SRSEXE and WINDOWS TTS, no matter what is defined in Moose_MSRS.lua -local msrs = MSRS:New() -msrs:SetBackendSRSEXE() -msrs:SetProvider(MSRS.Provider.WINDOWS) -msrs:SetFrequencies(251) - -local fileName = "Hello-world.txt" -local folderPath = lfs.writedir() .. 'Missions' -local delay = 5 - --- Broadcast text after 5 seconds. -MESSAGE:New( "I try to play the external text file now!" ):ToAll():ToLog() -msrs:PlayTextFile(string.format("%s\\%s", folderPath, fileName), delay) +--- +-- Author: kaltokri +-- Created: 28.12.2023 +-- Contributors: - +-- Modified: 17.02.2024 +-- +-- # Documentation: +-- https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Sound.SRS.html +-- +-- # Description: +-- +-- This demo mission will read an external text file. +-- This is a file which is not part of the .miz file. +-- If you don't own A-10CII you have to change the mission to use another aircraft and frequency. +-- +-- # Guide: +-- +-- 1. Save the file Hello-world.txt to your Missions folder, +-- e.g. C:\Users\\Saved Games\DCS.openbeta\Missions. +-- 2. Enter the A-10CII and listen to the radio. + +-- Check dcs.log if something is not working: +BASE:TraceClass("MSRS") +BASE:TraceLevel(3) +BASE:TraceOnOff( true ) + +-- Force to use SRSEXE and WINDOWS TTS, no matter what is defined in Moose_MSRS.lua +local msrs = MSRS:New() +msrs:SetBackendSRSEXE() +msrs:SetProvider(MSRS.Provider.WINDOWS) +msrs:SetFrequencies(251) + +local fileName = "Hello-world.txt" +local folderPath = lfs.writedir() .. 'Missions' +local delay = 5 + +-- Broadcast text after 5 seconds. +MESSAGE:New( "I try to play the external text file now!" ):ToAll():ToLog() +msrs:PlayTextFile(string.format("%s\\%s", folderPath, fileName), delay)