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 new file mode 100644 index 0000000000..e1d6935275 --- /dev/null +++ b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.lua @@ -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) diff --git a/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz new file mode 100644 index 0000000000..8e1790e157 Binary files /dev/null and b/Sound/MSRS/001-Play-internal-Sound-file/MSRS-001-Play-internal-Sound-file.miz differ diff --git a/Sound/MSRS/002-Play-external-Sound-file/Hello-world.ogg b/Sound/MSRS/002-Play-external-Sound-file/Hello-world.ogg new file mode 100644 index 0000000000..d094d94669 Binary files /dev/null and b/Sound/MSRS/002-Play-external-Sound-file/Hello-world.ogg differ 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 new file mode 100644 index 0000000000..48fd6e58fa --- /dev/null +++ b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.lua @@ -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\\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) diff --git a/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz new file mode 100644 index 0000000000..3171e1c885 Binary files /dev/null and b/Sound/MSRS/002-Play-external-Sound-file/MSRS-002-Play-external-Sound-file.miz differ