Ciribob Posted February 8 Share Posted February 8 (edited) This project aims to allow multiplayer mission designers (clients dont need to do anything) to easily embed live text to speech over SRS into their missions or play specified MP3s (radio station, background AI wingman chatter etc). Its a very powerful tool and already in use on the popular BlueFlag server - powering their automated AI GCI over the SRS (SimpleRadio Standalone) mod. Full setup instructions here: https://github.com/ciribob/DCS-SimpleTextToSpeech I've recorded a quick demo showing: Playing an MP3 over a set frequency - and triggering it with a trigger Using the Text to Speech function to read out something And i'll upload the demo shortly. Example calls: Text to speech STTS.TextToSpeech("Hello DCS WORLD","251","AM","1.0","SRS",2) Arguments in order are: - Message to say, make sure not to use a newline (\n) ! If the message fails to play - its too long. DO NOT USE " in the message - Frequency in MHz - Modulation - AM/FM - Volume - 1.0 max, 0.5 half - Name of the transmitter - ATC, RockFM etc - Coalition - 0 spectator, 1 red 2 blue This example will say the words "Hello DCS WORLD" on 251 MHz AM at maximum volume with a client called SRS and to the Blue coalition only Play MP3 STTS.PlayMP3("C:\\Users\\Ciaran\\Downloads\\PR-Music.mp3","255,31","AM,FM","0.5","Multiple",0) Arguments in order are: - FULL path to the MP3 to play - MP3 must have a sample rate over 16KHz - Frequency in MHz - to use multiple separate with a comma - Number of frequencies MUST match number of Modulations - Modulation - AM/FM - to use multiple - Volume - 1.0 max, 0.5 half - Name of the transmitter - ATC, RockFM etc - Coalition - 0 spectator, 1 red 2 blue This will play that MP3 on 255MHz AM & 31 FM at half volume with a client called "Multiple" and to Spectators only Edited February 8 by Ciribob 4 3 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Ciribob Posted February 8 Author Share Posted February 8 (edited) Example mission attached from the video - make the changes below to see it work YOU WILL NEED TO FOLLOW THE INSTRUCTIONS ON GITHUB STILL AND MAKE THE CHANGES BELOW Edit the LUA from https://github.com/ciribob/DCS-SimpleTextToSpeech/blob/master/DCS-SimpleTextToSpeech.lua and set the path correctly, then replace the current one in the mission Download the MP3 and set the path correctly to it in the DO SCRIPT (MP3 here) https://www.silvermansound.com/free-music/hard-sell-hotel . You will have to edit the existing triggers Unsantize the mission environment so its able to use os.execute (again check the github) Be running SRS Server and Client locally on the same machine at the mission Three calls used by the mission STTS.TextToSpeech("Enemy units located near the airfield","251","AM","1.0","SRS",2) STTS.TextToSpeech("C:\\Users\\Ciaran\\Downloads\\hard-sell-hotel.mp3","30","FM","1.0","SRS",2) STTS.TextToSpeech("All Enemies Destroyed! Well done! ","251","AM","1.0","SRS",2) SRS-STTS-Text.miz Edited February 8 by Ciribob 2 2 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Caster Posted February 8 Share Posted February 8 That's a great effect, can't wait to see what people do with it Fly fast and leave a pretty wreck Link to post Share on other sites
HILOK Posted February 8 Share Posted February 8 great stuff, thanks, ciribob i wonder, if the script could handle strings also (instead of plain text)? TM Cougar Idle/Cutoff Link to post Share on other sites
Ciribob Posted February 8 Author Share Posted February 8 37 minutes ago, HILOK said: great stuff, thanks, ciribob i wonder, if the script could handle strings also (instead of plain text)? not sure I quite follow - it does handle strings? local someString = "All Enemies Destroyed! Well done! " STTS.TextToSpeech(someString,"251","AM","1.0","SRS",2) would work 1 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
HILOK Posted February 8 Share Posted February 8 yep, exactly what i meant! quite frankly, i was thinking that could allow adding dynamic voice-overs to your great jtac script ? TM Cougar Idle/Cutoff Link to post Share on other sites
Ciribob Posted February 8 Author Share Posted February 8 58 minutes ago, HILOK said: yep, exactly what i meant! quite frankly, i was thinking that could allow adding dynamic voice-overs to your great jtac script ? Sure it could be Maybe one day! 1 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
kreisch Posted February 9 Share Posted February 9 Holy cow Many, many Kudos! I just played around with it and currently I'm integrating this into a mission for my squadron. Is it maybe possible in the (far) future to get additional voices? Br, kreisch Ugly-Squadron GamestarPinboard Link to post Share on other sites
Ciribob Posted February 9 Author Share Posted February 9 @kreisch its based on the microsoft APIs built into windows This blog gives a good overview: https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/june/speech-text-to-speech-synthesis-in-net If you install more language packs I could make them available with a future update Currently its hard-coded to female - english 1 1 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
deadlyfishes Posted February 10 Share Posted February 10 This is amazing and my team is already having a great time with it! I'm wondering if there's a way you could support ogg as well other than MP3 since mission designers may be forced to have to convert and duplicate their files that they use in DCS. "Through The Inferno" Endless, Dynamic, Open-World Experience for DCS World Website | Discord | Support TTI on Patreon SP Missions: Caucasus | NTTR |Syria| Persian Gulf | Normandy (Modern) | Normandy (WW2) MP Servers: PvE Server | PvP Server Link to post Share on other sites
Ciribob Posted February 11 Author Share Posted February 11 Could be done without too much difficulty I think. It would need an SRS update though as the external audio feature is part of SRS itself and tied to those releasesIf you PM me or add me to your TTI Dev channel I can give you a special build ahead of time thoughIf you're using it heavily there are some hidden features you can enable too like voice and localeSent from my HD1903 using Tapatalk Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Ciribob Posted February 16 Author Share Posted February 16 DCS-SR-ExternalAudio.rar Version of DCS-SR-ExternalAudio with .ogg file support along with MP3 This will be in the next SRS update, but if you need .ogg support now, use this Just replace the current one where ever you installed SRS Ogg files must end .ogg in order to be picked up 1 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Olddog Posted February 16 Share Posted February 16 I tried a few test of the .ogg version and it works great, many thanks Ciribob I also made a small change to your DCS-Simple Text to Speech.lua to minimize the command window from popping up when the script runs. This keeps the cmd window from popping up in my face. --snip STTS.EXECUTABLE = "DCS-SR-ExternalAudio.exe" function STTS.TextToSpeech(message,freqs,modulations, volume,name, coalition ) message = message:gsub("\"","\\\"") local cmd = string.format("start /B /min \"%s\" \"%s\\%s\" \"%s\" %s %s %s %s \"%s\" %s", STTS.DIRECTORY, STTS.DIRECTORY, STTS.EXECUTABLE, message, freqs, modulations, coalition,STTS.SRS_PORT, name, volume ) env.info("[DCS-STTS] TextToSpeech Command :\n" .. cmd.."\n") --os.execute(cmd) os.execute('start /min cmd /c ' .. cmd) end changed os.execute(cmd) to os.execute('start /min cmd /c ' .. cmd) Works fine for both the Speech and Audio. Link to post Share on other sites
Ciribob Posted February 16 Author Share Posted February 16 4 hours ago, Olddog said: I tried a few test of the .ogg version and it works great, many thanks Ciribob I also made a small change to your DCS-Simple Text to Speech.lua to minimize the command window from popping up when the script runs. This keeps the cmd window from popping up in my face. --snip STTS.EXECUTABLE = "DCS-SR-ExternalAudio.exe" function STTS.TextToSpeech(message,freqs,modulations, volume,name, coalition ) message = message:gsub("\"","\\\"") local cmd = string.format("start /B /min \"%s\" \"%s\\%s\" \"%s\" %s %s %s %s \"%s\" %s", STTS.DIRECTORY, STTS.DIRECTORY, STTS.EXECUTABLE, message, freqs, modulations, coalition,STTS.SRS_PORT, name, volume ) env.info("[DCS-STTS] TextToSpeech Command :\n" .. cmd.."\n") --os.execute(cmd) os.execute('start /min cmd /c ' .. cmd) end changed os.execute(cmd) to os.execute('start /min cmd /c ' .. cmd) Works fine for both the Speech and Audio. thanks for the suggestion - i'll make that change as well or a variation on it Glad the Ogg version works well! Once you get it running on a server, if you have any recordings or videos please do share as I'm really interested to see what people do with this Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Calwpower Posted February 21 Share Posted February 21 I was thinking it is not possible. to play radio stream via SRS. or is that only possible with local files .mp3 .ogg. ??? example https://stream.sunshine-live.de/2000er/mp3 Link to post Share on other sites
Ciribob Posted February 21 Author Share Posted February 21 I was thinking it is not possible. to play radio stream via SRS. or is that only possible with local files .mp3 .ogg. ???example https://stream.sunshine-live.de/2000er/mp3Maybe in the future, but supporting a live stream is much trickier than a local fileFor now it just supports local filesSent from my HD1903 using Tapatalk Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Calwpower Posted February 21 Share Posted February 21 37 minutes ago, Ciribob said: Vielleicht in der Zukunft, aber die Unterstützung eines Live-Streams ist viel schwieriger als eine lokale Datei Für jetzt unterstützt es nur lokale Dateien gesendet von meinem HD1903 mit Tapatalk I am trying to implement it myself, not so easy Link to post Share on other sites
Calwpower Posted February 22 Share Posted February 22 there was an error in PlayMP3 did not run, it changed, now it works function STTS.PlayMP3(pathToMP3,freqs,modulations, volume,name, coalition ) local cmd = string.format("start /B /min \"%s\" \"%s\\%s\" \"%s\" %s %s %s %s \"%s\" %s", STTS.DIRECTORY, STTS.DIRECTORY, STTS.EXECUTABLE, pathToMP3, freqs, modulations, coalition,STTS.SRS_PORT, name, volume ) env.info("[DCS-STTS] PlayMP3 Command :\n" .. cmd.."\n") os.execute(cmd) end Link to post Share on other sites
Ciribob Posted February 22 Author Share Posted February 22 there was an error in PlayMP3 did not run, it changed, now it works function STTS.PlayMP3(pathToMP3,freqs,modulations, volume,name, coalition ) local cmd = string.format("start /B /min \"%s\" \"%s\\%s\" \"%s\" %s %s %s %s \"%s\" %s", STTS.DIRECTORY, STTS.DIRECTORY, STTS.EXECUTABLE, pathToMP3, freqs, modulations, coalition,STTS.SRS_PORT, name, volume ) env.info("[DCS-STTS] PlayMP3 Command :\n" .. cmd.."\n") os.execute(cmd) endEnv.info is a log line?Can't see any error , that's just used for loggingSent from my HD1903 using Tapatalk Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
Mistermann Posted March 8 Share Posted March 8 @Ciribob - Brilliant! I just posted this the yesterday. Quote I stumbled on the Microsoft MSCognitiveTextToSpeech API plugin for Voice Attack. It allows VA to use a powerful Microsoft Azure text to speech engine instead of generic voices downloaded to our computer. If you have Voice Attack, I highly recommend checking it out as it adds immersion into the voice commands. Now ... I am just wondering out load here. Is it possible to script something in DCS/MOOSE/MIST that uses this service (its free unless you surpass a set usage)? I am using Bankler's Case I training for carrier landings and it displays real time feedback during the landing on how well you're doing. That feedback takes real time data (like altitude) and displays on the screen. This is all done in LUA. It dawned on me if the variable being used to print to the screen was passed into a "text to voice" API, we could turn that already incredibly useful mission into an even better training tool. Furthermore using this particular service gives us control over the language, the voice actor, the accent, as well as the voice's pitch and speed. While this wouldn't take the place of human actors 100%, it could replace the need to pre-record hundreds of lines of speech and allows mission editors to edit communications without the burden of re-recording Voice Acting. The plugin works pretty well for VA, so I was just wondering if someone smarter than me tried incorporating this API into MOOSE or some other scripting language I see your tool is using the MSFT API's built into Windows. I am curious ... might you consider also using the Azure CognitiveTextToSpeech service? It MIGHT be a way to introduce variability of the voices. I am definitely over my head from a tech standpoint, so I'll defer to your expertise here. Thanks for creating this extension! 2 MM [sIGPIC][/sIGPIC] ASUS P9X79 | i7 3930K | 16GB DDR3 | Nvidia Geforce GTX780 | Win7 64 | HOTAS Thrustmaster T.16000M & TWCS Yeah, I need a serious upgrade :) Link to post Share on other sites
Mistermann Posted March 8 Share Posted March 8 Also, how do I prevent the server command box from popping up over the top of DCS when executing a STTS.TextToSpeech command? MM [sIGPIC][/sIGPIC] ASUS P9X79 | i7 3930K | 16GB DDR3 | Nvidia Geforce GTX780 | Win7 64 | HOTAS Thrustmaster T.16000M & TWCS Yeah, I need a serious upgrade :) Link to post Share on other sites
Mistermann Posted March 8 Share Posted March 8 2 hours ago, Mistermann said: Also, how do I prevent the server command box from popping up over the top of DCS when executing a STTS.TextToSpeech command? I heard back on Discord that this is not currently part of the feature set and is being worked on. MM [sIGPIC][/sIGPIC] ASUS P9X79 | i7 3930K | 16GB DDR3 | Nvidia Geforce GTX780 | Win7 64 | HOTAS Thrustmaster T.16000M & TWCS Yeah, I need a serious upgrade :) Link to post Share on other sites
reptile92 Posted March 8 Share Posted March 8 On 2/9/2021 at 2:52 PM, Ciribob said: If you install more language packs I could make them available with a future update Currently its hard-coded to female - english Any ETA for this? I'm using a lot STTS, so it would be great to have different voice for each emitter 2 Link to post Share on other sites
Ciribob Posted March 8 Author Share Posted March 8 1 hour ago, reptile92 said: Any ETA for this? I'm using a lot STTS, so it would be great to have different voice for each emitter Probably this weekend 3 2 Scripts: Complete Transport And Logistics Deployment - CTLD / CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script Projects: DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! :) DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord Link to post Share on other sites
reptile92 Posted March 9 Share Posted March 9 My godness! I didn't expect such sort ETA! I'll be glad to test it (allready installed many voices for DATIS ) 1 Link to post Share on other sites
Recommended Posts