aboutsummaryrefslogtreecommitdiff
path: root/App.gd
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2021-11-26 09:22:33 -0500
committerAndrew Lee <alee14498@protonmail.com>2021-11-26 09:22:33 -0500
commit7f1cdc4663800fa9bdfddf888164826819d97e6e (patch)
tree1f2149dbe8e4712977c6f0f396ac25061f80dff2 /App.gd
parent6cb9ecfd6f6c863cd873a1b5e77972d542dfb1bc (diff)
downloaderable-godot-7f1cdc4663800fa9bdfddf888164826819d97e6e.tar.gz
erable-godot-7f1cdc4663800fa9bdfddf888164826819d97e6e.tar.bz2
erable-godot-7f1cdc4663800fa9bdfddf888164826819d97e6e.zip
Almost got music playing
Diffstat (limited to 'App.gd')
-rw-r--r--App.gd14
1 files changed, 9 insertions, 5 deletions
diff --git a/App.gd b/App.gd
index 1986e1d..0cab0dd 100644
--- a/App.gd
+++ b/App.gd
@@ -4,24 +4,28 @@ extends Control
# var a = 2
# var b = "text"
-var audio;
+var audioURL
# Called when the node enters the scene tree for the first time.
func _ready():
print("Erable is ready")
- pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_PlayButton_pressed():
- pass # Replace with function body.
+ print("Now playing music")
+ $AudioStreamPlayer.stream = load(audioURL)
+ $AudioStreamPlayer.play()
func _on_BrowseButton_pressed():
- $FileDialog.popup()
+ print("Opening file dialog")
+ $FileDialog.popup_centered()
func _on_FileDialog_file_selected(path):
print(path)
- audio = path
+ audioURL = "file://" + path
+func _on_AudioStreamPlayer_finished():
+ print("Music has finished playing")