Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Timofey |
how to open the file which is on the path like “D:\hello.txt”
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Timofey |
how to open the file which is on the path like “D:\hello.txt”
Reply From: | IvanVoirol |
Look there, I think it’s what you’re looking for : https://forum.godotengine.org/57130/how-to-import-and-read-text
Reply From: | Zylann |
Read the doc: https://docs.godotengine.org/en/stable/classes/class_file.html
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?
Timofey | 2020-09-17 16:47
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 Load wav or ogg file in C# from custom location? - Archive - Godot Forum
Zylann | 2020-09-17 17:56