Fixed issue of ATC not being recognised correctly; Introduced callsign and flight number; Fixed issue of numbers not being pronounced correctly

This commit is contained in:
MarStr 2024-07-11 21:27:31 +02:00
parent 3334c77fd3
commit 28fbd212f2
2 changed files with 31 additions and 9 deletions

View File

@ -38,13 +38,14 @@ atc_aws_voicemodel = 'standard'
# Define where your X-Plane log file is located
# This usually sits in the root of your X-Plane folder, named Log.txt
# -------------------------------------------------------------------
atc_xplane_log = "M:\\Flight Sim\\Simulator\\12\\Log.txt"
atc_xplane_log = "M:\\Flight Sim\\Simulator\\12\\Log_tmp.txt"
#atc_xplane_log = "C:\\Users\\windo\\Desktop\\Log.txt"
# -------------------------------------------------------------------
# Put in your call sign. Must be the same you entered in 124th ATC
# -------------------------------------------------------------------
atc_callsign = "MST 6012"
atc_callsign = "MST"
atc_flightno = "6012"
# -------------------------------------------------------------------
@ -122,7 +123,6 @@ while True:
c_idx = 0
for word in content:
if word == "Communication:":
c_idx = c_idx+1
break
c_idx = c_idx + 1
@ -140,7 +140,8 @@ while True:
# Pick a voice - depending on current situation
resp = ""
voice_to_use = -1
if content[c_idx+1] == atc_callsign:
content[c_idx+2] = content[c_idx+2].replace(",", "")
if content[c_idx+1] == atc_callsign and content[c_idx+2] == atc_flightno:
vc = random.randrange(len(atc_voices))
if vc == atc_pilot_voice:
vc = vc-1
@ -158,6 +159,21 @@ while True:
if atc_show_responses == True:
print(" > " + resp + " - [" + atc_voices[voice_to_use] + "]: " + newline)
# Let's replace the actual numbers with written, phonetic numbers to avoid things like
# "6012" audible as "six thousand twelve". Note the space after each number.
# We need to do this after the string checks performed before.
# Placing this here shows original text in console - but pronounces the numbers correctly.
newline = newline.replace("0", "Zero ")
newline = newline.replace("1", "One ")
newline = newline.replace("2", "Two ")
newline = newline.replace("3", "Three ")
newline = newline.replace("4", "Four ")
newline = newline.replace("5", "Five ")
newline = newline.replace("6", "Six ")
newline = newline.replace("7", "Seven ")
newline = newline.replace("8", "Eight ")
newline = newline.replace("9", "Niner ")
# Generate voice!
# Let's keep it at OGG - best compromize between data transfer size and quality
response = atc_polly_client.synthesize_speech(VoiceId=atc_voices[voice_to_use], OutputFormat='ogg_vorbis', Text = newline, Engine = atc_aws_voicemodel)

View File

@ -79,17 +79,18 @@ The next section defines where the text log of X-Plane is located. Typically thi
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.
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.
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.
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
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
[code]MST 6012[/code]
This is what you will need to enter at the line
This is what you will need to enter at these lines:
[code]atc_callsign = "MST 6012"[/code]
[code]atc_callsign = "MST"
atc_flightno = "6012"[/code]
Replace this with your callsign.
Replace this with your own call sign and flight number.
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.
@ -132,3 +133,8 @@ The sound format is OGG Vorbis. I would recommend you to leave it at that. It is
[section]Future plans[/section]
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.
[section]History[/section]
1.01 - Fixed issue of ATC not being recognised correctly; Introduced callsign and flight number; Fixed issue of numbers not being pronounced correctly
1.0 - Initial release