- removed recorded speech (propretiary software)

- use speech TTS in FG
This commit is contained in:
Slawek Mikula
2017-10-20 00:52:35 +02:00
parent 08a4fcb0ee
commit d60078f893
43 changed files with 50 additions and 9388 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 KiB

View File

@@ -1,12 +0,0 @@
<?xml version="1.0"?>
<PropertyList>
<path>scientist.ac</path>
<animation>
<type>range</type>
<min-m>0</min-m>
<max-m>100</max-m>
</animation>
</PropertyList>

View File

@@ -357,7 +357,7 @@
<name>Tourist</name>
<type>model</type>
<activated>1</activated>
<path>Missions/PHLI-tour/Models/scientist.xml</path>
<path>/Missions/Generic/Models/People/scientist.xml</path>
<orientation>
<heading-deg>150.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -375,7 +375,7 @@
<name>Tourist-2</name>
<type>model</type>
<activated>0</activated>
<path>Missions/PHLI-tour/Models/scientist.xml</path>
<path>/Missions/Generic/Models/People/scientist.xml</path>
<orientation>
<heading-deg>30.0</heading-deg>
<pitch-deg>0.0</pitch-deg>

Binary file not shown.

View File

@@ -83,7 +83,7 @@
<name>Intro 1</name>
<type>dialog-action</type>
<text>Welcome to the FlightGear flight simulator!</text>
<sound-file>Welcome.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -91,7 +91,7 @@
<name>Intro 2</name>
<type>dialog-action</type>
<text>This is the test mission.</text>
<sound-file>msg1.wav</sound-file>
<speak>1</speak>
<delay-sec>2</delay-sec>
</object>
@@ -99,7 +99,7 @@
<name>Intro 3</name>
<type>dialog-action</type>
<text>Fly through all the hoops.</text>
<sound-file>msg2.wav</sound-file>
<speak>1</speak>
<delay-sec>2</delay-sec>
</object>
@@ -266,7 +266,7 @@
<name>Hoop1_active</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-40x40.xml</path>
<path>/Missions/Generic/Models/hoop-40x40.xml</path>
<orientation>
<heading-deg>88.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -283,7 +283,7 @@
<name>Hoop1_active</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/Numbers/num_1.xml</path>
<path>/Missions/Generic/Models/Numbers/num_1.xml</path>
<orientation>
<heading-deg>88.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -300,7 +300,7 @@
<name>Hoop1_inactive</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-100x100-red.xml</path>
<path>/Missions/Generic/Models/hoop-100x100-red.xml</path>
<orientation>
<heading-deg>88.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -318,7 +318,7 @@
<name>Hoop2_active</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-40x40.xml</path>
<path>/Missions/Generic/Models/hoop-40x40.xml</path>
<orientation>
<heading-deg>56.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -335,7 +335,7 @@
<name>Hoop2_active</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/Numbers/num_2.xml</path>
<path>/Missions/Generic/Models/Numbers/num_2.xml</path>
<orientation>
<heading-deg>56.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -352,7 +352,7 @@
<name>Hoop2_inactive</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-100x100-red.xml</path>
<path>/Missions/Generic/Models/hoop-100x100-red.xml</path>
<orientation>
<heading-deg>56.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -370,7 +370,7 @@
<name>Model_Hoop_3</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-100x100-red.xml</path>
<path>/Missions/Generic/Models/hoop-100x100-red.xml</path>
<orientation>
<heading-deg>24.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -388,7 +388,7 @@
<name>Model_Hoop_4</name>
<type>model</type>
<activated>0</activated>
<path>Aircraft/Missions/Generic/Models/hoop-100x100-red.xml</path>
<path>/Missions/Generic/Models/hoop-100x100-red.xml</path>
<orientation>
<heading-deg>20.0</heading-deg>
<pitch-deg>0.0</pitch-deg>

View File

@@ -73,7 +73,7 @@
<name>Intro 1</name>
<type>dialog-action</type>
<text>Welcome to the FlightGear flight simulator!</text>
<sound-file>Welcome.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -81,7 +81,7 @@
<name>Intro 2</name>
<type>dialog-action</type>
<text>This is the test mission.</text>
<sound-file>msg1.wav</sound-file>
<speak>1</speak>
<delay-sec>2</delay-sec>
</object>
@@ -89,7 +89,7 @@
<name>Intro 3</name>
<type>dialog-action</type>
<text>Fly through all the hoops.</text>
<sound-file>msg2.wav</sound-file>
<speak>1</speak>
<delay-sec>2</delay-sec>
</object>
@@ -97,7 +97,7 @@
<name>End 1</name>
<type>dialog-action</type>
<text>Congratulations! You have completed your first mission.</text>
<sound-file>msg4a.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>

View File

@@ -15,8 +15,7 @@
<activated>0</activated>
<single-shot>0</single-shot>
<airport-id>KLVK</airport-id>
<!--runway>25R</runway>
<runway>25L</runway-->
<runway>25L</runway>
<landing-type>full stop</landing-type>
<actions>
<object-reference>MSG_KLVK</object-reference>

View File

@@ -7,8 +7,6 @@
<heading-deg>180</heading-deg>
<latitude-deg>37.71937556</latitude-deg>
<longitude-deg>-122.4988623</longitude-deg>
<!--latitude-deg type="double">53.63305452</latitude-deg>
<longitude-deg type="double">-3.175471265</longitude-deg-->
</presets>
<timeofday>afternoon</timeofday>
@@ -44,7 +42,7 @@
<name>Intro_msg</name>
<type>dialog-action</type>
<text>A tourist is ready to fly to the airport.</text>
<sound-file>Intro1.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -134,7 +132,7 @@
<name>Tourist</name>
<type>model</type>
<activated>1</activated>
<path>Missions/Flight-to-KHAF/Models/scientist.xml</path>
<path>/Missions/Generic/Models/People/scientist.xml</path>
<orientation>
<heading-deg>180.0</heading-deg>
<pitch-deg>0.0</pitch-deg>

View File

@@ -77,7 +77,7 @@
<name>Intro_msg</name>
<type>dialog-action</type>
<text>A tourist is ready to fly to the airport.</text>
<sound-file>Intro1.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -85,7 +85,7 @@
<name>Start_engines_msg</name>
<type>dialog-action</type>
<text>Start the engines</text>
<sound-file>start_the_engines.wav</sound-file>
<speak>1</speak>
<delay-sec>2</delay-sec>
</object>
@@ -93,7 +93,7 @@
<name>Cleared_to_take_off_msg</name>
<type>dialog-action</type>
<text>You are cleared to take-off</text>
<sound-file>cleared_to_take_off.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -101,7 +101,7 @@
<name>Follow_compass_msg</name>
<type>dialog-action</type>
<text>Follow the mission compass.</text>
<sound-file>follow_compass.wav</sound-file>
<speak>1</speak>
<delay-sec>3</delay-sec>
</object>
@@ -357,7 +357,7 @@
<name>Tourist</name>
<type>model</type>
<activated>1</activated>
<path>Missions/PHLI-tour/Models/scientist.xml</path>
<path>/Missions/Generic/Models/People/scientist.xml</path>
<orientation>
<heading-deg>150.0</heading-deg>
<pitch-deg>0.0</pitch-deg>
@@ -375,7 +375,7 @@
<name>Tourist-2</name>
<type>model</type>
<activated>0</activated>
<path>Missions/PHLI-tour/Models/scientist.xml</path>
<path>/Missions/Generic/Models/People/scientist.xml</path>
<orientation>
<heading-deg>30.0</heading-deg>
<pitch-deg>0.0</pitch-deg>

View File

@@ -8,11 +8,15 @@
# fgcommand("play-audio-sample", props.Node.new(sound));
#}
var show_message = func (m, delay, snd = nil) {
var show_message = func (m, delay, speak = nil, snd = nil) {
setprop("/sim/mission/message/current-message", m);
setprop("/sim/mission/message/message-delay", delay);
setprop("/sim/mission/message/show-message", 1);
if (speak != nil) {
mission.speak(m);
}
if (snd != nil) {
mission.play_sound(snd);
}
@@ -27,6 +31,7 @@ mission.extension_add("MissionObject", {
node : n,
name : n.getValue("name"),
_message : n.getValue("text"),
_speak : n.getValue("speak"),
_sound_file : n.getValue("sound-file"),
_delay : (n.getValue("delay-sec") or 5),
};
@@ -34,7 +39,7 @@ mission.extension_add("MissionObject", {
return m;
},
start: func show_message(me._message, me._delay, me._sound_file),
start: func show_message(me._message, me._delay, me._speak, me._sound_file),
stop: func,

View File

@@ -14,15 +14,6 @@ mission.extension_add("MissionObject", {
return m;
},
# _play_sound: func {
# var sound = {
# path : me._sound_path,
# file : me._sound_file, #file,
# volume : 1
# };
# fgcommand("play-audio-sample", props.Node.new(sound));
# },
start: func mission.play_sound(me._sound_file),
stop: func,

View File

@@ -24,9 +24,6 @@ var init_gui = func {
},
},
{ #1
label: "Toggle compass",
},
{ #2
label: "Stop mission",
binding: {
command: "nasal",

View File

@@ -91,7 +91,6 @@ var stop_mission = func {
return;
}
foreach(var obj; mission_objects) {
obj.del();
}
@@ -130,8 +129,9 @@ var activate_object = func(name, start = 1) {
var activate_object_group = func(group, start = 1) {
foreach(var ref; group.getChildren("object-reference"))
foreach(var ref; group.getChildren("object-reference")) {
activate_object(ref.getValue(), start);
}
}
@@ -195,13 +195,27 @@ var get = func(node, path, default = nil) {
}
}
var file_found = func(filename) {
return call(io.readfile, [filename], nil, nil, var err=[]);
}
var play_sound = func (file) {
var filepath = mission_root ~ "/Sounds/";
if (!file_found(filepath ~ "/" ~ file)) {
filepath = getprop("/sim/mission/root_path") ~ "/Missions/Generic/Sounds";
}
var sound = {
path : mission_root ~ "/Sounds",
path : filepath,
file : file,
volume : 1
};
fgcommand("play-audio-sample", props.Node.new(sound));
}
var speak = func (text) {
setprop("/sim/sound/voices/atc", text);
}
print("Mission loaded");