Ciribob Posted February 8, 2021 Posted February 8, 2021 (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. 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) ! - 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 STTS.TextToSpeech("Microsoft russian female text to speech","251","AM","1.0","SRS",2,null,1,"female","ru-RU","Microsoft Irina Desktop") Arguments in order are: - Message to say, make sure not to use a newline (\n) ! - 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 - Position of the transmitter - null so igored - Speed of the voice - 1 being normal - Gender of the voice - Locale of the voice - Name of the specific voice This example will say the words "Microsoft russian female text to speech" on 251 MHz AM at maximum volume with a client called SRS and to the Blue coalition only using the Microsoft TTS engine with the specified voice STTS.TextToSpeech("Google Text to Speech","251","AM","1.0","SRS",2,null,1,"female","cz-CZ","cs-CZ-Wavenet-A",true) Arguments in order are: - Message to say, make sure not to use a newline (\n) ! - 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 - Position of the transmitter - null so igored - Speed of the voice - 1 being normal - Gender of the voice - Locale of the voice - Name of the specific voice - Use Google Text to Speech This example will say the words "Google Text to Speech" on 251 MHz AM at maximum volume with a client called SRS and to the Blue coalition only using a specifc Google TTS voice. You will need to setup a Google App Engine project and set the STTS script to point the correct location of the Google Credentials STTS.TextToSpeech("Hello DCS WORLD","251","AM","1.0","SRS",2,Unit.getByName("RADIO"):getPoint()) Arguments in order are: - Message to say, make sure not to use a newline (\n) ! - 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 with the location of the transmission set to the location of a unit called "RADIO". This will respect Line of Sight and Distance Limitations if enabled STTS.PlayMP3("C:\\Users\\Ciaran\\Downloads\\PR-Music.ogg","255,31","AM,FM","0.5","Multiple",0) Arguments in order are: - FULL path to the MP3 or Ogg audio to play - 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 STTS.PlayMP3("C:\\Users\\Ciaran\\Downloads\\PR-Music.mp3","255,31","AM,FM","0.5","Multiple",2,Unit.getByName("RADIO"):getPoint()) Arguments in order are: - FULL path to the MP3 to play - 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 with the location of the transmission set to the location of a unit called "RADIO". This will respect Line of Sight and Distance Limitations if enabled Example of a transmission with position: Edited April 25, 2021 by Ciribob 4 4 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
Ciribob Posted February 8, 2021 Author Posted February 8, 2021 (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 April 25, 2021 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
Caster Posted February 8, 2021 Posted February 8, 2021 That's a great effect, can't wait to see what people do with it Fly fast and leave a pretty wreck
HILOK Posted February 8, 2021 Posted February 8, 2021 great stuff, thanks, ciribob i wonder, if the script could handle strings also (instead of plain text)?
Ciribob Posted February 8, 2021 Author Posted February 8, 2021 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
HILOK Posted February 8, 2021 Posted February 8, 2021 yep, exactly what i meant! quite frankly, i was thinking that could allow adding dynamic voice-overs to your great jtac script ?
Ciribob Posted February 8, 2021 Author Posted February 8, 2021 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
kreisch Posted February 9, 2021 Posted February 9, 2021 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
Ciribob Posted February 9, 2021 Author Posted February 9, 2021 @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
deadlyfishes Posted February 10, 2021 Posted February 10, 2021 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 | Afghanistan | Iraq | Mariana Islands | Persian Gulf | Normandy | South Atlantic | Sinai | Kola MP Servers: PvE Server TTI x Pimax - Get discounts on Pimax Headsets
Ciribob Posted February 11, 2021 Author Posted February 11, 2021 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
Ciribob Posted February 16, 2021 Author Posted February 16, 2021 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 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
Olddog Posted February 16, 2021 Posted February 16, 2021 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. 1
Ciribob Posted February 16, 2021 Author Posted February 16, 2021 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 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
Calwpower Posted February 21, 2021 Posted February 21, 2021 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
Ciribob Posted February 21, 2021 Author Posted February 21, 2021 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
Calwpower Posted February 21, 2021 Posted February 21, 2021 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
Calwpower Posted February 22, 2021 Posted February 22, 2021 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
Ciribob Posted February 22, 2021 Author Posted February 22, 2021 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
Mistermann Posted March 8, 2021 Posted March 8, 2021 @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 System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 365 Into The Jungle Apache Campaign - Griffins Kiowa Campaign - Assassins Thrustmaster TWCS Mod
Mistermann Posted March 8, 2021 Posted March 8, 2021 Also, how do I prevent the server command box from popping up over the top of DCS when executing a STTS.TextToSpeech command? System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 365 Into The Jungle Apache Campaign - Griffins Kiowa Campaign - Assassins Thrustmaster TWCS Mod
Mistermann Posted March 8, 2021 Posted March 8, 2021 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. System Specs: Spoiler Callsign:Kandy Processor:13th Gen Intel(R) Core(TM) i9-13900K - RAM: 64GB - Video Card: NVIDIA RTX 4090 - Display: Pimax 8kx VR Headset - Accessories: VKB Gunfighter III MCG Ultimate, VKB STECS Standard, Thrustmaster TPR Pedals, Simshaker JetPad, Predator HOTAS Mounts, 3D Printed Flight Button Box Video Capture Software: Open Broadcaster Software (OBS), Video Editing Software: PowerDirector 365 Into The Jungle Apache Campaign - Griffins Kiowa Campaign - Assassins Thrustmaster TWCS Mod
reptile92 Posted March 8, 2021 Posted March 8, 2021 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
Ciribob Posted March 8, 2021 Author Posted March 8, 2021 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
reptile92 Posted March 9, 2021 Posted March 9, 2021 My godness! I didn't expect such sort ETA! I'll be glad to test it (allready installed many voices for DATIS ) 1
Recommended Posts