0 votes

Hello, fellow Godot users.

I'm developing a Speech to Text (STT) module for Godot (2.1.3 build) using an open source speech recognition library. This library uses configuration files, which I stored inside my experimental game project.

The main problem I've encountered is getting the absolute path to the configuration files to work after exporting the game; after all, the library doesn't recognize res:// paths.

The game works inside the editor, since my module can get absolute paths with the Globals singleton. For example:

Globals::get_singleton()->globalize_path("res://stt/keywords.kws")

The above line converts the file path on my Ubuntu 16.04 to /home/my_user/other_stuff/stt/keywords.kws. However, this absolute path doesn't work with an exported, binary game (I've tried on own Unix system), since the configuration files are stored inside the binary itself.

The only way I've found to run the binary would be to place library-related files on the same directory, but that defeats the purpose of having them inside the project in the first place!

I've tried looking around the FileAccess and DirAccess Godot classes for a workaround, but with no success. Is there any class/function to accomplish this? Or should I store my library-related files externally (in the user:// path, for example)?

I'd really appreciate any suggestions or comments. :)

asked Sep 10, 2017 in Engine by SamuraiSigma (25 points)

1 Answer

0 votes

From what I've discussed with other developers, instead of getting an external path for the config files, it would be best to copy them to user:// at the beginning of the game and get paths from there.

answered Sep 21, 2017 by SamuraiSigma (25 points)
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 How to use this Q&A? before posting your first questions.