0 votes

how to open the file which is on the path like "D:\hello.txt"

in Engine by (157 points)

2 Answers

0 votes

Look there, I think it's what you're looking for : https://godotengine.org/qa/57130/how-to-import-and-read-text

by (188 points)
0 votes
by (29,034 points)

thanks, it helped. Or you can file for example 'D:\music.mp3' put on stream AudioStreamPlayer and play this file? If you need to convert a file to a specific format, how to do it?

Playing arbitrary audio files is quite a different question from opening a txt file.

MP3 is not supported by Godot, it can't read or convert it.
OGG and WAV can be read though. One person posted an answer on how to do it with C#, so hopefully it should be easy to write the same thing in GDScript with a few syntax changes https://godotengine.org/qa/81678/load-wav-or-ogg-file-in-c%23-from-custom-location?show=81678#q81678

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.