语音提示暂提

This commit is contained in:
joylink_fanyuhong 2024-05-11 14:27:21 +08:00
parent aad74312e6
commit 9b9135b073
4 changed files with 31 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://ch844lptcf1d4"
path="res://.godot/imported/2hmgmgz.mp3-e53057236583099f00476818ff341eec.mp3str"
[deps]
source_file="res://Assets/training_speech/gmgz/2hmgmgz.mp3"
dest_files=["res://.godot/imported/2hmgmgz.mp3-e53057236583099f00476818ff341eec.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -17,7 +17,15 @@ func _on_training_desc_dialog_start_training():
$DepartTimer.one_shot = true $DepartTimer.one_shot = true
$DepartTimer.connect("timeout", depart) $DepartTimer.connect("timeout", depart)
$DepartTimer.start() $DepartTimer.start()
var sound = load_mp3("res://Assets/training_speech/gmgz/2hmgmgz.mp3")
$VoiceCommunication.play_reply(sound)
func depart(): func depart():
$total.closeScreenDoor() $total.closeScreenDoor()
func load_mp3(path):
var file = FileAccess.open(path, FileAccess.READ)
var sound = AudioStreamMP3.new()
sound.data = file.get_buffer(file.get_length())
return sound

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://b5yffodicwqm4"] [gd_scene load_steps=5 format=3 uid="uid://b5yffodicwqm4"]
[ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="1_efkp6"] [ext_resource type="PackedScene" uid="uid://qh8b3g6n3k2u" path="res://trainings/training_desc_dialog.tscn" id="1_efkp6"]
[ext_resource type="Script" path="res://trainings/trainingCloseDoorFault/trainingCloseDoorFault.gd" id="1_iggb0"] [ext_resource type="Script" path="res://trainings/trainingCloseDoorFault/trainingCloseDoorFault.gd" id="1_iggb0"]
[ext_resource type="PackedScene" uid="uid://btcksdsburk7t" path="res://sceen/total.tscn" id="2_ykkar"] [ext_resource type="PackedScene" uid="uid://btcksdsburk7t" path="res://sceen/total.tscn" id="2_ykkar"]
[ext_resource type="PackedScene" uid="uid://6lortgihx5jy" path="res://Communication/voice_communication.tscn" id="4_v0grr"]
[node name="TrainingCloseDoorFault" type="Node"] [node name="TrainingCloseDoorFault" type="Node"]
script = ExtResource("1_iggb0") script = ExtResource("1_iggb0")
@ -15,4 +16,6 @@ sceneDesc = "上行门头灯亮关门故障"
[node name="DepartTimer" type="Timer" parent="."] [node name="DepartTimer" type="Timer" parent="."]
[node name="VoiceCommunication" parent="." instance=ExtResource("4_v0grr")]
[connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"] [connection signal="StartTraining" from="TrainingDescDialog" to="." method="_on_training_desc_dialog_start_training"]