I'm simply trying to play a sound file, mp3, wave, whatever, that lives outside the resource folder, using a file dialog. I'm pretty certain I have the correct code. AudioStreamPlayer volume is set to 24 (max), but no sound emits. Player doesn't play. This is my code:
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
$btnSelect.connect("pressed", self, "_on_Button_pressed")
$FileDialog.connect("file_selected", self, "_on_FileDialog_file_selected")
func _on_Button_pressed():
$FileDialog.visible = true
func _on_FileDialog_file_selected(path):
print(path)
__play_stream(path)
func __play_stream(path):
$AudioStreamPlayer.stream = load(path)
$AudioStreamPlayer.play()
Seems like it should work. No error is posted. On file dialog selected I have confirmed that the correct path is returned.