# Define where your X-Plane log file is located\r
# This usually sits in the root of your X-Plane folder, named Log.txt\r
# -------------------------------------------------------------------\r
-atc_xplane_log = "M:\\Flight Sim\\Simulator\\12\\Log.txt"\r
+atc_xplane_log = "M:\\Flight Sim\\Simulator\\12\\Log_tmp.txt"\r
#atc_xplane_log = "C:\\Users\\windo\\Desktop\\Log.txt"\r
\r
# -------------------------------------------------------------------\r
# Put in your call sign. Must be the same you entered in 124th ATC\r
# -------------------------------------------------------------------\r
-atc_callsign = "MST 6012"\r
+atc_callsign = "MST"\r
+atc_flightno = "6012"\r
\r
\r
# -------------------------------------------------------------------\r
c_idx = 0\r
for word in content:\r
if word == "Communication:":\r
- c_idx = c_idx+1\r
break\r
c_idx = c_idx + 1\r
\r
# Pick a voice - depending on current situation\r
resp = ""\r
voice_to_use = -1\r
- if content[c_idx+1] == atc_callsign:\r
+ content[c_idx+2] = content[c_idx+2].replace(",", "")\r
+ if content[c_idx+1] == atc_callsign and content[c_idx+2] == atc_flightno:\r
vc = random.randrange(len(atc_voices))\r
if vc == atc_pilot_voice:\r
vc = vc-1\r
if atc_show_responses == True:\r
print(" > " + resp + " - [" + atc_voices[voice_to_use] + "]: " + newline)\r
\r
+ # Let's replace the actual numbers with written, phonetic numbers to avoid things like\r
+ # "6012" audible as "six thousand twelve". Note the space after each number.\r
+ # We need to do this after the string checks performed before.\r
+ # Placing this here shows original text in console - but pronounces the numbers correctly.\r
+ newline = newline.replace("0", "Zero ")\r
+ newline = newline.replace("1", "One ")\r
+ newline = newline.replace("2", "Two ")\r
+ newline = newline.replace("3", "Three ")\r
+ newline = newline.replace("4", "Four ")\r
+ newline = newline.replace("5", "Five ")\r
+ newline = newline.replace("6", "Six ")\r
+ newline = newline.replace("7", "Seven ")\r
+ newline = newline.replace("8", "Eight ")\r
+ newline = newline.replace("9", "Niner ")\r
+\r
# Generate voice!\r
# Let's keep it at OGG - best compromize between data transfer size and quality\r
response = atc_polly_client.synthesize_speech(VoiceId=atc_voices[voice_to_use], OutputFormat='ogg_vorbis', Text = newline, Engine = atc_aws_voicemodel)\r
\r
This is a default example I left in - you need to find the path of your file. This can also be on a network drive - important is that the Python script can access this location. Notice the double backslashes for the folder delimiters.\r
\r
-You will now need to enter your call sign. In 124thATC when you file a flight plan, you will be asked to provide a flight number which has two fields. What you enter here is your call sign.\r
+You will now need to enter your call sign and flight number. In 124thATC when you file a flight plan, you will be asked to provide a callsign and flight number, which has two fields. What you enter here is your call sign.\r
\r
-In my case, I use "MST" on the left, and "6012" on the right. The resulting callsign will be a string made up of those two with a space. For me this is \r
+In my case, I use "MST" as my callsign, and "6012" on the right as my flight number. The resulting callsign will be a string made up of those two with a space. For me this is \r
\r
[code]MST 6012[/code]\r
\r
-This is what you will need to enter at the line\r
+This is what you will need to enter at these lines:\r
\r
-[code]atc_callsign = "MST 6012"[/code]\r
+[code]atc_callsign = "MST"\r
+atc_flightno = "6012"[/code]\r
\r
-Replace this with your callsign.\r
+Replace this with your own call sign and flight number.\r
\r
Next, decide whether or not you want a voice for readbacks and/or communication from the cockpit to be played as audio. If you set this to False, only ATC communication will be audible.\r
\r
[section]Future plans[/section]\r
\r
I may need to figure out how to efficiently read X-Plane's dataref values so that I can further enhance realism. For example only pick another voice if you left a certain area or changed the type of contact. I will be looking into this at some time - for now I am happy with how this has turned out.\r
+\r
+\r
+[section]History[/section]\r
+1.01 - Fixed issue of ATC not being recognised correctly; Introduced callsign and flight number; Fixed issue of numbers not being pronounced correctly \r
+1.0 - Initial release
\ No newline at end of file