Failed to load resource: /home/[usr]/.local/share/Rhythm Game Mayhem/Levels/Toby Fox - Spider Dance/audio.wav (-3)

I am trying to load a .wav file using sys.load_resource, and for a reason i can’t figure out, it is giving me the above error. As i have been typing this out, i do realize that it could just be me trying to load an incompatible file type but if this is the case, it would be helpful if i could get some help as to what would be a better method or an alternative

any help would be greatly appreciated, thanks

sys.load_resource()is for reading resources in our archive file (aka [custom resources](Working with files))

:warning: Beware that loading files from any place isn’t a portable way for all the platforms.

As for loading directly from disc, you can use Lua’s io.* module.

Then you can use the [sound.create_sound_data()](API reference (Resource)) to add it to the engine.

Then set the sound [hash property](API reference (Resource)), and you should be ready to play.

Here’s an example, albeit from streaming from Http:

1 Like