Jump to content

Recommended Posts

Posted (edited)

I'm writing a large script to do multiple things (like a MOOSE / MIST but just using the DCS Scripting Language) and I'd like to have Audio Files play at certain points. 

At the moment I can add my script to any mission just using one line in a DO SCRIPT action and everything the script can do, works even if I never made the mission myself.

However, the one thing I'd like to do is play sounds WITHOUT having to load them (by hand) or by Trigger Action into the .miz file.

Is this possible? 

The script is sitting in a know folder on the dedicated server, so all the sound files could be in there too. 
 

i.e. using lfs or something?

 

Any help please?

Edited by Elphaba
Posted (edited)
12 hours ago, Elphaba said:

Outside of the .miz file.

HAHAHAHA😃

You haven't upload any code so to get a specific answer.

PS: It can be done.

Edited by ADHS

Democracy was already invented, while Scrat was eating oak fruits.

Posted
36 minutes ago, ADHS said:

PS: It can be done.

Do you have some sample code? I tried the following

local path = lfs.writedir() .. "Missions\\".."fife.ogg"
trigger.action.outSound(path)

and it did not work for me (DCS de-sanitized, lfs is available and writedir returns correct path to */Saved Games/DCS/). The path to the sound file is correct, fife.ogg exists in the Missions directory, can be played by any sound file player, but unfortunately no sound plays. What am I missing? 

  • Like 1
Posted
45 minutes ago, ADHS said:

HAHAHAHA😃

You haven't upload any code so to get a specific answer.

PS: It can be done.

 

I was asking the question to get help/advice/tips - not because I had written any script that wasn’t yet working. I haven’t tried yet because I wanted to know what others had done/found first. 

Posted (edited)
3 hours ago, Elphaba said:

I'm writing a large script to do multiple things

not because I had written any script

All of us have LOTS of Imagination of how to code.

Personally i would like to answer to a specific question to an uploaded draft of specific code, and

not to make assumptions in a hypothetic riddle of a school or an employer's type of examinations.

Sorry man, but you haven't uploaded nothing of your own code, hense to get even a tip as an answer.

Edited by ADHS
  • Like 1

Democracy was already invented, while Scrat was eating oak fruits.

Posted (edited)
10 hours ago, ADHS said:

All of us have LOTS of Imagination of how to code.

Personally i would like to answer to a specific question to an uploaded draft of specific code, and

not to make assumptions in a hypothetic riddle of a school or an employer's type of examinations.

Sorry man, but you haven't uploaded nothing of your own code, hense to get even a tip as an answer.

 

This is supposed to a be a COMMUNITY. You might want to look up what that word means?

If I don't know it's possible then there is no point in wasting time trying, especially when others have been there and tried it before and can pass on their advice.

You claim it's possible but refuse to provide any help whatsoever without any code... and yet another member of the COMMUNITY has provided code for you, and you have completely ignored them. 

Why are you gatekeeping? If you really knew that this was indeed possible, a civilised person would point people into the right direction to investigate at the least, or like most everyone else IN THIS COMMUNITY you'd provide code for someone to learn from - like @cfrag or @grimes and many, many others often do. 

Your attitude is severely lacking. Here, let ME help YOU.

Edited by Elphaba
Posted
17 hours ago, cfrag said:

Do you have some sample code? I tried the following

local path = lfs.writedir() .. "Missions\\".."fife.ogg"
trigger.action.outSound(path)

and it did not work for me (DCS de-sanitized, lfs is available and writedir returns correct path to */Saved Games/DCS/). The path to the sound file is correct, fife.ogg exists in the Missions directory, can be played by any sound file player, but unfortunately no sound plays. What am I missing? 

What if you copied in your sounds at script initialise into the mission .miz. Would they then play?

Posted
8 hours ago, Elphaba said:

This is supposed to a be a COMMUNITY. You might want to look up what that word means?

If I don't know it's possible then there is no point in wasting time trying, especially when others have been there and tried it before and can pass on their advice.

You claim it's possible but refuse to provide any help whatsoever without any code... and yet another member of the COMMUNITY has provided code for you, and you have completely ignored them. 

Why are you gatekeeping? If you really knew that this was indeed possible, a civilised person would point people into the right direction to investigate at the least, or like most everyone else IN THIS COMMUNITY you'd provide code for someone to learn from - like @cfrag or @grimes and many, many others often do. 

Your attitude is severely lacking. Here, let ME help YOU.

No.

Democracy was already invented, while Scrat was eating oak fruits.

  • 1 month later...
Posted (edited)

as i know, there is no way to do it, except to put ALL the ogg files inside the miz file.  I made some time, a library for a TTS atc in lua , and i would have loved to externalize it like a library in user files.  no way so far.   Miz files can be opened with a zip app, and once ogg injected. you still can reopen inside M.E and resave it. but also you will need to index ogg file like that inside L10n\DEFAUT\mapresource

" use a .txt file to list all your ATC Strings you need,  standard text editor
2)   use a online TTS interpreter and load your .txt file inside  ( like 
https://www.naturalreaders.com/online/
3)   test some different voice and choose one. Reload your txt file inside and get ready
4)   open Audacity set recorder on stereo mixing launch « record » in Audacity
5)   record Audacity file / project 
6)   set some mark (edit menu ) «  Ctrl B » and extand it from beginning and end of each sound
7)   name this for each this will be the soundfilenamegenerated
😎   once all mark and soundfilesname defined save your project
9)   play with script template (file menu) you can generate always the same preset for towerATC and 
an other preset for playerA / player B etc …( use lowpass highpass filter and equalization walkie 
talkie)
10) once OK  do « multiple export » to generate soundfiles regarding markers and soundnamedefined 
for each marker
11) files are done inside your work directory !
12) Now we want to use it easily in DCS mission editor we want to rename it
13) with « THE rename » freeware soft, prefix on left each sound with his voice « ATC1_ » for exemple
14) we also want to prefix on right ( sound lengh ).ogg
15) first we prefix on right text « («
16) then we prefix on right « sound «  « %lengh% » in OGG part.
17) Then we prefix on right text « ) »
18) finally we want to generate a text list directly usable inside the DCS mission.
19) First of all export file list in pdf with print directory function inside « the rename » soft
20) in the pdf viewer select text tool and select all your files
21) copy paste in excel file or open office calc 
22)  using concatenate function generate a column with this indexed format beginning at 10000 
23)   ["ResKey_Action_10015"] = "ATC_F1_0.ogg", 
["ResKey_Action_10016"] = "ATC_F1_1.ogg", 
["ResKey_Action_10017"] = ....
24) open inside your miz file ( with winrar for exemple ) the L10n\DEFAUT\mapresource file in a text 
editor
25) copy paste the whole column (23) as text, inside the brackets {   here   }
26) save
27) accept to update the .miz file ( winrar notification ) 
28) move all your .ogg from your sound folder  inside the miz file here L10n\DEFAUT\
29) Done ! 
30) Ogg file won't be deleted, and will stay inside the miz file,  no matter your next modification 
inside the DCS mission editor, adding new object, resave inside mission editor etc …
31) optionnal :  to generate a quick text list to copy past on ATME script «  on start  handler you can 
use concatenate the same way as (22)  to get a column with this final  format where lengh is 
retreive from name imported (16):
 ATME.C_Sound("ATC_F1_ALLOWEDTOTO","ATC_F1_allowedtoTO.ogg", 1, " allowed to take off ", 1)
ATME.C_Sound("ATC_F1_ANCHORON", "ATC_F1_anchoron.ogg", 1, " anchor on ", 1)
ATME.C_Sound("ATC_F1_ANGELS", "ATC_F1_angels.ogg", 0.8, " angels ", 1)"

Edited by snowsniper
 

 i7-10700KF CPU  3.80GHz - 32 GO Ram - - nVidia RTX 2070 -  SSD Samsung EVO with LG  TV screen 40"  in 3840x2150 -  cockpit scale 1:1

- MS FFB2 Joystick  - COUGAR F16 throttle  - Saitek Pro Flight Rudder Pedals

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...