I have tried this code in three different IDEs and I get the same result in all
three: Even though the file to be loaded is in the same directory as the code is, I always get the 'failed to open file : sound.wav
Make sure that the file is in the project directory, or the directory that the IDE wants the file to be. (This may or may not be in the source code directory, you must check it yourself.)