0 votes

Hi,

I have a bunch of sound files in res://sfx/ and in my code I use Directory to get a list of the files, basically:

var ext = ".ogg"
dir.open(path)
dir.list_dir_begin()
while true:
    var file = dir.get_next()
    if file.ends_with(ext):
        files.append(file)
return files 

The I use sfx = load(audio_file)

It works when running from the editor but when the game is packaged up in a PCK file, the directory no longer contains OGG or WAV files. It still has ogg.import and wave.import files. Not sure what's going on.

Any suggestions appreciated!

asked Feb 14, 2018 in Engine by dodgyville (192 points)
edited Feb 14, 2018 by dodgyville

Under Project > Export > Resources try adding *.ogg, *.wav to the first text box, should be labelled "Filters to export non-resource files".

Ah, thank you very much!

I guess my other question would be: Am I handling sound files the right way? If they're being imported into the engine as a resource, is there some way I should be calling them other than loading the ogg or wav file direct?

Please log in or register to answer this question.

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.