I have a script that allows the user to select an audio file (ogg or wav) and play it. If this file is outside the project folder, then copy it to the folder project:
var fileName = "res://Audio/SE/%s" % current_file
if !dir.file_exists(fileName):
current_file = current_file.to_lower()
dir.copy(path, fileName)
# TODO: create import
# PLAY AUDIO
var stream = load(fileName)
$MyAudioSreamPlayer.stream = stream
$MyAudioSreamPlayer.play()
but you can not play it because .import file is missing. Then, how i create this import file to this audio?
Note: .import file is created for this new audio when i click over godot editor main window but i need create it just after line dir.copy(path, fileName) in my script